Heroku: Why isn't the config/database.yml file relevant?

50 views
Skip to first unread message

Jason Hsu, Rubyist

unread,
Feb 20, 2015, 6:50:50 PM2/20/15
to rubyonra...@googlegroups.com
As you know, Heroku uses the PostgreSQL database by default.

However, when you deploy an app that you created with the use of SQLite in the development environment, the config/database.yml file on the Heroku server is still configured for SQLite.

Exactly how does Heroku make the config/database.yml file relevant?  How does the app get the database name, username, and password in the Heroku environment?

Frederick Cheung

unread,
Feb 21, 2015, 2:40:02 AM2/21/15
to rubyonra...@googlegroups.com
On older rails versions heroku entirely rewrites the database.yml file. On rails 4.2 it doesn't need to because rails will use a DATABASE_URL environment variable if it is set. See https://devcenter.heroku.com/articles/heroku-postgresql#connecting-in-ruby for more details

Fred

ANIL YADAV

unread,
Feb 21, 2015, 3:06:58 AM2/21/15
to rubyonra...@googlegroups.com
I think you need to changed your production configuration ...in your yml files...


production:
<<: *default
database: name_production
username: name
password: <℅= ENV['NAME_DATABASE_PASSWORD']℅>


the ENV tag automatic generated a unique password for your rail application on heroku production.... I am not confirm. Because I am also a new developer.

ANIL YADAV

unread,
Feb 21, 2015, 3:06:59 AM2/21/15
to rubyonra...@googlegroups.com

ANIL YADAV

unread,
Feb 21, 2015, 3:07:00 AM2/21/15
to rubyonra...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages