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.
Ed0ed02dac87a0181698d83cdf7e7775?d=identicon&s=25 psimoes (Guest)
on 2007-06-08 16: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.
2f9a03aa0fcfe945229cb6126eda2cb2?d=identicon&s=25 Philip Hallstrom (Guest)
on 2007-06-08 17: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
Ed0ed02dac87a0181698d83cdf7e7775?d=identicon&s=25 psimoes (Guest)
on 2007-06-08 18:29
(Received via mailing list)
Exactly, I thought the YAML files were smarter :)
This topic is locked and can not be replied to.