Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

dispatcher should only be loaded if ActionController is defined

#721

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

Reported by José Valim · July 29th, 2008 @ 07:41 PM

State: resolved
Milestone: 2.1.1
Assigned to: Jeremy Kemper Jeremy Kemper
Importance: none

Activity

  1. Hugo Barauna
    Hugo Barauna
    • Title changed from dispatcher should only be loaded if ActionController is defined to +1

    I also had to hack it myself.

    July 29th, 2008 @ 09:52 PM

  2. Jeremy Kemper
    Jeremy Kemper
    • Assigned user set to Jeremy Kemper
    • Title changed from +1 to dispatcher should only be loaded if ActionController is defined
    • State changed from new to open
    • Milestone changed from 2.x to 2.1.1

    July 30th, 2008 @ 01:18 AM

  3. Repository
    Repository
    • State changed from open to resolved

    (from [931d4629d29642145094bd0ad34660d3482d9e9c]) Initializer skips prepare_dispatcher if Action Controller isn't in use. [#721 state:resolved]

    http://github.com/rails/rails/co...

    July 30th, 2008 @ 10:07 AM

  4. Repository
    Repository

    (from [c8e80f6389b45134c0514dde6736488cf5507765]) Initializer skips prepare_dispatcher if Action Controller isn't in use. [#721 state:resolved]

    http://github.com/rails/rails/co...

    July 30th, 2008 @ 10:07 AM