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? Commented Jul 2, 2013 at 5:37
  • Yes I have multiple times. Commented 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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.