Reputation: 13
I recently deployed my rails app on Heroku. In the process I accidentally deleted my database.yml file. I restored the file from the most recent copy in my git repository, however, now every time I try to log in to my development environment (on localhost:3000), it tells me:
ActiveRecord::ConnectionNotEstablished
.
I am using the mysql2 adapter and running ruby 1.8.7 on rails 3.0.9
I am confused because I believe I have restored my app to its exact state prior to deploying...
the development part of my database.yml file:
development:
adapter: mysql2
encoding: utf8
reconnect: false
database: thankfl_development
pool: 5
username: ------
password: ------
socket: /tmp/mysql.sock
I can still access the database through the rails console, just not through the browser.
Any ideas what I could do?
Upvotes: 1
Views: 875
Reputation: 33954
Did you restart your web server (webrick, thin, passenger, apache, or whatever), after restoring the .yml
file? The database .yml
file is read at startup, not on every request, so any changes/adds/removes involving that file require a web server restart, even in development mode.
That would explain why the console is working (since it loads the database.yml
file when it opens), but your dev app doesn't.
Upvotes: 4