Getting config.eager_load is set to nil while trying to run rails c in test

Needs to set

config.eager_load = false

for config/environments/development.rb and test.rb or = true for production.rb (as default)


You need to declare the env before you run the commands:

RAILS_ENV=test bundle exec rails c

I get the same output on my computer:

> bundle exec rails c RAILS_ENV=test                                                                                                               ian@Ians-MacBook-Pro
config.eager_load is set to nil. Please update your config/environments/*.rb files accordingly:

  * development - set it to false
  * test - set it to false (unless you use a tool that preloads your test environment)
  * production - set it to true

but when I run as suggested:

> RAILS_ENV=test bundle exec rails c                                                                                                               ian@Ians-MacBook-Pro
Loading test environment (Rails 4.2.3)

As for Windows systems:

  1. This should do:

    rails c -e test
    
  2. Or set the RAILS_ENV variable first:

    set RAILS_ENV=test
    rails c