This project is archived and is in readonly mode.

#721 ✓resolved
José Valim

dispatcher should only be loaded if ActionController is defined

Reported by José Valim | July 29th, 2008 @ 07:41 PM | in 2.1.1

I was trying to create an environment where only ActiveRecord and ActionMailer were loaded but it failed on the last step.

The dispatcher is loaded even if ActionController is not defined. To fix it I just needed to add the line below to railties/lib/initializer.rb, on the prepare_dispatcher method, around line 480:

return unless configuration.frameworks.include?(:action_controller)

So we have:

def prepare_dispatcher

return unless configuration.frameworks.include?(:action_controller)

require 'dispatcher' unless defined?(::Dispatcher)

Dispatcher.define_dispatcher_callbacks(configuration.cache_classes)

Dispatcher.new(RAILS_DEFAULT_LOGGER).send :run_callbacks, :prepare_dispatch

end

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Tags

Pages