I have the following 2.0 config:
version: 2
jobs:
build:
docker:
- image: circleci/ruby:2.4.1-node
environment:
RAILS_ENV: test
DATABASE_URL: postgresql://circleci:circleci@127.0.0.1:5432/test_db
- image: circleci/postgres:9.6-postgis-ram
environment:
POSTGRES_DB: test_db
POSTGRES_USER: circleci
POSTGRES_PASSWORD: circleci
steps:
- checkout
- run: bundle install
- run: bundle exec rails db:schema:load
- run: bundle exec rails test:app
When the container boots for postgres, I get the error:
FATAL: role “rolename” does not exist
Job was canceled
The rolename is from database.yml config, yet I have set DATABASE_URL and RAILS_ENV so it should be using those.
I have ssh’d in to the box to check the env variables which are all as expected.
$ rails c
$ puts ENV[‘DATABASE_URL’]
postgresql://circleci:circleci@127.0.0.1:5432/test_db
$ puts ENV[‘RAILS_ENV’]
test