Rails adapter chooses CgiApp over ActionController::Dispatcher in ruby 1.8
Reported by Arrix Zhou | August 29th, 2009 @ 09:03 PM | in Future
In my testing with ruby 1.8.7 and Rails 2.3.3, @rails_app has the type Rack::Adapter::Rails::CgiApp instead of the Rack compliant ActionController::Dispatcher.
In thin/lib/rack/adapter/rails.rb at line 25
@rails_app = if ActionController.const_defined?(:Dispatcher) && ActionController::Dispatcher.instance_methods.include?(:call)
ActionController::Dispatcher.new
else
CgiApp.new
end
In ruby 1.8, Object#instance_methods returns an Array of Strings (while ruby 1.9 returns an Array of Symbols) so include?(:call) always returns false.
A possible fix is ActionController::Dispatcher.instance_methods.map{|m| m.to_sym}.include?(:call)
Comments and changes to this ticket
-
macournoyer August 30th, 2009 @ 09:00 PM
- State changed from new to resolved
(from [932d33e49ede7d0d90624be7ba2a5b654e02a550]) Fix test for rack based Rails in adapter under Ruby >= 1.8.7 [#109 state:resolved] http://github.com/macournoyer/thin/commit/932d33e49ede7d0d90624be7b...
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
People watching this ticket
Referenced by
- 109 Rails adapter chooses CgiApp over ActionController::Dispatcher in ruby 1.8 (from [932d33e49ede7d0d90624be7ba2a5b654e02a550]) Fix tes...