0

My database.yml is as follows:

development:
  adapter: postgresql
  database: phunt_development
  username: <%= ENV['PG_USER'] %>
  password: <%= ENV['PG_PASS'] %>
  host: localhost
  pool: 5
  timeout: 5000

And I can confirm that the database phunt_development does exist. However when I run ActiveRecord::Base.connection.current_database I get development not phunt_development. I can't figure out why Rails is insisting on connecting to the general development database, which is polluted with data I have from other local apps. I want to connect to phunt_development.

2
  • 1
    Have you restart your server/console after making changes in database.yml?
    – Salil
    Jul 2, 2013 at 5:37
  • Yes I have multiple times.
    – Sam Stern
    Jul 2, 2013 at 7:44

1 Answer 1

3

Issue was a $DATABASE_URL variable was set in my environment. When this is set, it overrides the configuration in database.yml. Solution: run unset DATABASE_URL.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.