This project is archived and is in readonly mode.
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
-
Hugo Barauna July 29th, 2008 @ 09:52 PM
- Title changed from dispatcher should only be loaded if ActionController is defined to +1
I also had to hack it myself.
-
Jeremy Kemper July 30th, 2008 @ 01:18 AM
- 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
-
Repository July 30th, 2008 @ 10:07 AM
- State changed from open to resolved
(from [931d4629d29642145094bd0ad34660d3482d9e9c]) Initializer skips prepare_dispatcher if Action Controller isn't in use. [#721 state:resolved]
-
Repository July 30th, 2008 @ 10:07 AM
(from [c8e80f6389b45134c0514dde6736488cf5507765]) Initializer skips prepare_dispatcher if Action Controller isn't in use. [#721 state:resolved]
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>