UPDATE:
Answer is here: http://mikebian.co/fixing-invalid-database_url-reference-on-circleci/
tldr: Don’t use single quotes in your database.yml, as they are filtered out. So: pool: <%= ENV["DB_POOL"] || ENV['RAILS_MAX_THREADS'] || 5 %>
becomes pool: <%= ENV["DB_POOL"] || ENV["RAILS_MAX_THREADS"] || 5 %>