(RuntimeError) :database is nil in repository configuration

I’ve set the following environment variables in my circle.yml file:

machine:
  environment:
    DB_NAME_TEST: social_app_api_test
    DB_PASSWORD_TEST:
    DB_HOSTNAME_TEST: localhost
    DB_USERNAME_TEST: postgres

But while executing the tests, I’m getting the following error:

** (RuntimeError) :database is nil in repository configuration

Link: https://circleci.com/gh/ghoshnirmalya/social_app_api/12#config/containers/0

Solved this issue.

1 Like

Hello @ghoshnirmalya,

I’m glad you worked it out, could you please share your solution here?

Best,
Zak

The issue was I was using the wrong database file. I’ve three database configuration files - testing, development and production. I was using the development whereas I should be using the testing configuration.