Rails 5: Load lib files in production
<p>I've upgraded one of my apps from Rails 4.2.6 to Rails 5.0.0. The <a href="http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#autoloading-is-disabled-after-booting-in-the-production-environment" rel="noreferrer">Upgrade Guide</a> says, that the Autoload feature is now disabled in production by default.</p>

<p>Now I always get an error on my production server since I load all lib files with autoload in the <code>application.rb</code> file.</p>

<pre><code>module MyApp
    class Application &lt; Rails::Application
        config.autoload_paths += %W( lib/ )
    end
end
</code></pre>

<p>For now, I've set the <code>config.enable_dependency_loading</code> to <code>true</code> but I wonder if there is a better solution to this. There must be a reason that Autoloading is disabled in production by default.</p>