title: LoadError (Unable to autoload constant Error::ErrorHandler
body: <p>I'm trying to build the error module for the entire application. I've created one error_handler.rb inside lib/error directory and added</p>
  
  <pre><code>config.eager_load_paths &lt;&lt; Rails.root.join('lib')
  </code></pre>
  
  <p>in config/application.rb.</p>
  
  <p>error_handler.rb</p>
  
  <pre><code>module Error
   module ErrorHandler
  
   def self.included(klass)
    klass.class_eval do
      rescue_from ::ActiveRecord::RecordNotFound do |e|
        respond(:record_not_found, 404, e.to_s)
      end
      rescue_from ::StandardError do |e|
        respond(:standard_error, 500, e.to_s)
      end
    end
   end
  
   private
   def respond(_error, _status, _message)
    json = Helpers::Render.json(_error, _status, _message)
    render json: json
   end
  end
  end
  </code></pre>
  
  <p>I've included this module in ApplicationController</p>
  
  <pre><code>include Error::ErrorHandler
  </code></pre>
  
  <p>But whenever I try to hit any errors console is throwing</p>
  
  <pre><code>LoadError (Unable to autoload constant Error::ErrorHandler, expected /Users/username/path/lib/error/error_handler.rb to define it):
  
  Error during failsafe response: Unable to autoload constant Error::ErrorHandler
  </code></pre>
  
  <p>Can anyone please help me with this? Thanks</p>