Activerecord::Adapternotspecified Database Configuration Does Not Specify Adapter

ActiveRecord::AdapterNotSpecified database configuration does not specify adapter

For you app to work locally you need to:

  1. Install Postgresql on your machine
  2. Create a database for your development needs (let's call it my_app_development)
  3. Change your database.yml to:

    default: &default
    adapter: postgresql
    encoding: unicode
    # For details on connection pooling, see rails configuration guide
    # http://guides.rubyonrails.org/configuring.html#database-pooling
    pool: 5

    development:
    <<: *default
    database: my_app_development
  4. run rake db:migrate

Rails 6 on Heroku: ActiveRecord::AdapterNotSpecified: database configuration does not specify adapter

The problem has been solved by adding the 'adapter' to 'production' in the database.yml. This wasn't necessary when our project was on Rails 4 and 5.

production:
adapter: postgresql

Database configuration does not specify adapter (Sinatra + Heroku + Activerecord)

I had the same problem today, and contacted Heroku support for assistance.

They directed me to a recent change in their Ruby build pack, see here: https://devcenter.heroku.com/changelog-items/709

I updated my database.yml file to reflect the change, and reference the DATABASE_URL for production, and my app is deploying again.

production:
url: <%= ENV['DATABASE_URL'] %>


Related Topics



Leave a reply



Submit