title: Railtie Initializer not running in plugin
body: <p>I recently switched from the gem version of <code>resources_controller</code> to a <code>plugin</code> as the <code>gem</code> version relied on <code>git</code>.  </p>
  
  <p>Inside the <code>vendor/plugins/plugin/lib/plugin.rb</code> file, the <code>Railtie</code> is as follows:</p>
  
  <pre><code>module Ardes
    module ResourcesController
      class Railtie &lt; Rails::Railtie
        initializer 'ardes.resources_controller' do
          ActiveSupport.on_load(:action_controller) do
            extend Ardes::ResourcesController
            include Ardes::ResourcesController::RequestPathIntrospection
          end
  
          ActiveSupport.on_load(:active_record) do
            include Ardes::ActiveRecord::Saved
          end
        end
      end
    end
  end
  </code></pre>
  
  <p>I've added a <code>require 'resources_controller'</code> in one of my initializers and it's properly loading this file.  The problem is that although the <code>Railtie</code> is evaluated (a <code>puts</code> in the class block will hit), it never seems to actually call the initializer block itself.  This is important of course as this is where it extends <code>ActionController</code> to include the <code>resources_controller_for</code> method.</p>
  
  <p>This question is appears to have come up <a href="https://stackoverflow.com/questions/5856614/why-railtie-initializers-are-not-executed">here</a> and <a href="https://stackoverflow.com/questions/3702488/railsrailtie-trouble-creating-a-rails-3-gem">here</a>.  Though in both cases they found other ways around the problem and no direct answer was given for why the block wasn't being called.</p>
  
  <p>From what I can tell in the Rails docs you can name your initializer block anything you'd like and it should run.  I don't think it matters, but I first noticed the problem when running in production <code>rails s -e production</code> though I believe the same problem exists in development mode.</p>
  
  <p>What may be going on?</p>
  
  <p>For reference, full plugin is here: <a href="https://github.com/ianwhite/resources_controller" rel="nofollow noreferrer">https://github.com/ianwhite/resources_controller</a></p>