ActiveView::Template::Error ( uninitialized constant CustomBreadcrumbsBuilder )
<p>I'm using a gem called <a href="https://github.com/weppos/breadcrumbs_on_rails" rel="nofollow"><code>breadcrumbs_on_rails</code></a>, and in order to use a view for this gem, I have created a class named: <code>CustomBreadcrumbsBuilder</code> in my <code>lib/</code> directory as fellows:</p>

<pre><code>class CustomBreadcrumbsBuilder &lt; BreadcrumbsOnRails::Breadcrumbs::Builder
  def render
    @context.render "/layouts/breadcrumbs", elements: @elements
  end
end
</code></pre>

<p>And I'm using this class in <code>application.html.haml</code> file to render the very layout in the following way:</p>

<pre><code>%main
  = render_breadcrumbs builder: ::CustomBreadcrumbsBuilder
</code></pre>

<p>It successfully loads the file in development environment, but in production, it's producing the following error:</p>

<pre><code>ActionView::Template::Error (uninitialized constant CustomBreadcrumbsBuilder):
</code></pre>

<p>I have tried the following things:</p>

<p>Added following to my <code>config/application.rb</code>:</p>

<pre><code>config.autoload_paths += %W(#{config.root}/lib/)
</code></pre>

<p>And</p>

<pre><code>config.autoload_paths &lt;&lt; "#{Rails.root}/lib"
</code></pre>

<p>But none of thing is working. Again, it is working in development mode, but fails in production.</p>

<p>I'm using Rails 5.0.0, and ruby 2.2.3, and on production, I'm using Puma and Nginx to serve the requests.</p>