I followed commented guidelines in config/application.rb which is
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
But when i added Rails.application.config.eager_load_paths << Rails.root.join('lib')
in config/initializers/eager_load.rb
.
It throws <top (required)>': can't modify frozen Array (RuntimeError)
Yes it is working if i put it inside config/application.rb
.
I want to know why is it not working on initializer and how to make it work using the convention ?
Try this instead in config/initializers/xxx.rb
:
Rails.application.config.eager_load_paths += [Rails.root.join('lib')]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With