问题
I recently restarted POW. On reloading the Rails app I'm working on, it hung.
Checking Rails' logs I get the following repeating every 5-20 seconds:
Connecting to database specified by database.yml
I can interact with the Postgres db without issue through the Rails console, so there is no problem there. I haven't changed anything in my database.yml for weeks, so I don't think the problem is there.
What might be the problem and how can I debug it?
回答1:
Turns out it was caused by POW
I had set '$powder always_restart` which was causing some sort of loop.
I reset this using `$ powder no_restarts'
回答2:
Change your production database temporary to your development settings.
Then run in your terminal: rails console production
Most of the times it is not about your database, but probably a syntax error. Anyways you can debug it like this.
来源:https://stackoverflow.com/questions/16498451/rails-connecting-to-database-specified-by-database-yml