From 04c3880d7905c58c634972980a7b8b82d44f8092 Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Sat, 12 Aug 2017 16:33:32 +0200 Subject: [PATCH] Use config.eager_load_paths in production See http://guides.rubyonrails.org/upgrading_ruby_on_rails.html#autoloading-is-disabled-after-booting-in-the-production-environment --- config/application.rb | 4 ++-- config/environments/production.rb | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config/application.rb b/config/application.rb index 6410e0bc1..3a115d764 100644 --- a/config/application.rb +++ b/config/application.rb @@ -35,8 +35,8 @@ module Diaspora # -- all .rb files in that directory are automatically loaded. # Custom directories with classes and modules you want to be autoloadable. - config.autoload_paths += %W{#{config.root}/app} - config.autoload_once_paths += %W{#{config.root}/lib} + config.autoload_paths += %W[#{config.root}/app] + config.autoload_once_paths += %W[#{config.root}/lib] # Only load the plugins named here, in the order given (default is alphabetical). # :all can be used as a placeholder for all plugins not explicitly named. diff --git a/config/environments/production.rb b/config/environments/production.rb index b6cdb8cab..65d1bc1de 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -9,6 +9,7 @@ Rails.application.configure do # and those relying on copy on write to perform better. # Rake tasks automatically ignore this option for performance. config.eager_load = true + config.eager_load_paths += %W[#{config.root}/lib] # Full error reports are disabled and caching is turned on. config.consider_all_requests_local = false