psimoes
2007-Jun-08 14:33 UTC
connecting to other databases not development, production, test
Hello,
I''ve set my database.yml like this:
development:
adapter: mysql
database: teste_development
username: root
password:
socket: /var/run/mysqld/mysqld.sock
test:
adapter: mysql
database: teste_test
username: root
password:
socket: /var/run/mysqld/mysqld.sock
production:
adapter: mysql
database: teste_production
username: root
password:
socket: /var/run/mysqld/mysqld.sock
other_db:
adapter: mysql
database: somedatabase
username: user
password: pass
socket: /var/run/mysqld/mysqld.sock
host: localhost
In the model I set the connection with: establish_connection
"other_db"
When I run the controller in the browser I get the following error:
other_db database is not configured
Did I miss something? (I restarted the web server)
Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Philip Hallstrom
2007-Jun-08 15:49 UTC
Re: connecting to other databases not development, production, test
> Hello, > > I''ve set my database.yml like this:....> production: > adapter: mysql > database: teste_production > username: root > password: > socket: /var/run/mysqld/mysqld.sock > > other_db: > adapter: mysql > database: somedatabase > username: user > password: pass > socket: /var/run/mysqld/mysqld.sock > host: localhost > > > In the model I set the connection with: establish_connection > "other_db" > > When I run the controller in the browser I get the following error: > other_db database is not configured > > Did I miss something? (I restarted the web server)Maybe a copy/paste error, but that last entry looks like you are using tabs, not spaces... and YAML files hate tabs... ? -philip --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
psimoes
2007-Jun-08 16:29 UTC
Re: connecting to other databases not development, production, test
Exactly, I thought the YAML files were smarter :) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---