Add lib folder path to eager_load_paths
Because autoloading is disabled in production with Rails 5, using autoload_paths will not load needed classes from specified paths. The solution to this, is to ask Rails to eager load classes. https://sipsandbits.com/2017/02/14/upgrading-a-ruby-on-rails-application/
This commit is contained in:
committed by
voodoorai2000
parent
08d7863bb5
commit
2ba7355b00
@@ -13,7 +13,7 @@ Rails.application.configure do
|
|||||||
# Because autoloading is disabled in production environments with Rails 5,
|
# Because autoloading is disabled in production environments with Rails 5,
|
||||||
# using autoload_paths will not load needed classes from specified paths.
|
# using autoload_paths will not load needed classes from specified paths.
|
||||||
# The solution to this, is to ask Rails to eager load classes.
|
# The solution to this, is to ask Rails to eager load classes.
|
||||||
config.eager_load_paths << "#{config.root}/lib"
|
config.eager_load_paths += ["#{config.root}/lib"]
|
||||||
|
|
||||||
# Full error reports are disabled and caching is turned on.
|
# Full error reports are disabled and caching is turned on.
|
||||||
config.consider_all_requests_local = false
|
config.consider_all_requests_local = false
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ Rails.application.configure do
|
|||||||
# Because autoloading is disabled in production environments with Rails 5,
|
# Because autoloading is disabled in production environments with Rails 5,
|
||||||
# using autoload_paths will not load needed classes from specified paths.
|
# using autoload_paths will not load needed classes from specified paths.
|
||||||
# The solution to this, is to ask Rails to eager load classes.
|
# The solution to this, is to ask Rails to eager load classes.
|
||||||
config.eager_load_paths << "#{config.root}/lib"
|
config.eager_load_paths += ["#{config.root}/lib"]
|
||||||
|
|
||||||
# Full error reports are disabled and caching is turned on.
|
# Full error reports are disabled and caching is turned on.
|
||||||
config.consider_all_requests_local = false
|
config.consider_all_requests_local = false
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ Rails.application.configure do
|
|||||||
# Because autoloading is disabled in production environments with Rails 5,
|
# Because autoloading is disabled in production environments with Rails 5,
|
||||||
# using autoload_paths will not load needed classes from specified paths.
|
# using autoload_paths will not load needed classes from specified paths.
|
||||||
# The solution to this, is to ask Rails to eager load classes.
|
# The solution to this, is to ask Rails to eager load classes.
|
||||||
config.eager_load_paths << "#{config.root}/lib"
|
config.eager_load_paths += ["#{config.root}/lib"]
|
||||||
|
|
||||||
# Full error reports are disabled and caching is turned on.
|
# Full error reports are disabled and caching is turned on.
|
||||||
config.consider_all_requests_local = false
|
config.consider_all_requests_local = false
|
||||||
|
|||||||
Reference in New Issue
Block a user