(RuntimeError) :database is nil in repository configuration


#1

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


#2

Solved this issue.


#3

Hello @ghoshnirmalya,

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

Best,
Zak


#4

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.


#5