When I use heroku open my web app works fine but when I\'m using rails s (localhost) I am running into this error:
ActiveRecord::AdapterNotSpecified database
In my case the reason was in my Rakefile.
when I run rake db:migrate
, I got this:
rake db:migrate
rake aborted!
ActiveRecord::AdapterNotSpecified: The `default_env` database is not configured for the `default_env` environment.
Available databases configurations are:
development
test
production
I've found this row in my Rakefile:
ActiveRecord::Base.establish_connection(ENV['DATABASE_URL'])
and changed with default value:
ActiveRecord::Base.establish_connection(ENV['DATABASE_URL'] || 'postgres://localhost/db_name')
and now it works fine. Details you can find here