Forum: Ruby on Rails connecting to other databases not development, production, t

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
psimoes (Guest)
on 2007-06-08 18:34
(Received via mailing list)
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.
Philip H. (Guest)
on 2007-06-08 19:36
(Received via mailing list)
> Hello,
>
> I've set my database.yml like this:
....
>        username: user
>
> 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
psimoes (Guest)
on 2007-06-08 20:29
(Received via mailing list)
Exactly, I thought the YAML files were smarter :)
This topic is locked and can not be replied to.