Rails exclude folder from auto/eager load Rails exclude folder from auto/eager load ruby-on-rails ruby-on-rails

Rails exclude folder from auto/eager load


I hope that 3 years later you may have already found the solution. Anyway...

You may try this:

  • api-v1-production

Add this to your config/environments/api-v1-production:

config.eager_load_paths -= ["#{config.root}/app/controllers/api/v[^2]"]
  • api-v2-production

Add this to your config/environments/api-v2-production:

config.eager_load_paths -= ["#{config.root}/app/controllers/api/v[^2]"]

Hope it works.