I am setting up a Ruby on Rails app on Heroku. Heroku apparently does not support SQLite3, which is Rails' native database, but instead prefers PostgreSQL. So I'm switching production to that database.
database.yml
default: &default
adapter: sqlite3
pool: 5
timeout: 5000
development:
<<: *default
database: db/development.sqlite3
test:
<<: *default
database: db/test.sqlite3
production:
url: <%= ENV['DATABASE_URL'] %>
Gemfile
(relevant portion)
group :production do
gem 'pg'
end
group :development, :test do
gem 'sqlite3'
end
And the error I'm getting in the browser is:
An unhandled lowlevel error occurred. The application logs may have details.
Digging into the application logs, it seems the error there is:
#<RuntimeError: Missingsecret_key_basefor 'production' environment, set this value inconfig/secrets.yml`>
I've confirmed that the correct DATABASE_URL environment variable is set in my Heroku settings. And I've got config/secrets.yml in .gitignore. I don't really want to track this file. I'm using Rails 5.0.1. What am I doing wrong here? The database credentials are included in the DATABASE_URL environment variable.
Activity Feed > Build Log? I am not seeing any errors there.database.yml. The default behaviour in Rails is to useENV['DATABASE_URL']if its present. You can get the rails logs by running$ heroku logs