mongrel
                                
                                 mongrel copied to clipboard
                                
                                    mongrel copied to clipboard
                            
                            
                            
                        uninitialized constant ActionController::AbstractRequest with --prefix option
I'm using 1.1.5 but this appears to still be an issue in master. Apparently the ActionController has been changed heavily in newer versions of rails and no longer has a AbstractRequest class. I'm currently using 2.3.4. I have tested and this can be fixed with the following:
-        ActionController::AbstractRequest.relative_url_root = ops[:prefix] if ops[:prefix]
+        ActionController::Base.relative_url_root = ops[:prefix] if ops[:prefix]
in lib/mongrel/rails.rb
That will break older versions of Rails.
A better patch that covers support for 2.2 and 2.3 versions will be good.
Thank you
Hi Luis,
I believe this workaround in lib/mongrel/rails.rb will deal with multiple versions of Rails:
151c151,158
<         ActionController::AbstractRequest.relative_url_root = ops[:prefix] if ops[:prefix]
---
>         # hack to deal with removal of ActionController::AbstractRequest
>         if defined? ActionController::AbstractRequest
>           # Rails < 2.3
>           ActionController::AbstractRequest.relative_url_root = ops[:prefix] if ops[:prefix]
>         else
>           # Rails >= 2.3
>           ActionController::Base.relative_url_root = ops[:prefix] if ops[:prefix]
>         end
FYI, some folks have attempted corresponding workarounds in Rails
Thank you siggy for the workaround.
Going to apply this to master and see the results across 1.2, 2.2, 2.3 and 3 version of Rails.
Thanks siggy! I've been busy and haven't had time to look back at this so I'm glad to see progress made!
Hello siggy and gmjosack
The issue is deeper than just the AbstractRequest call. Internal changes around dispatcher and the way request are handled will not work.
You can see this here:
http://gist.github.com/391471
The idea is bring the rack adapter from Unicorn to fix that issue, but not going to happen in 1.2 version.
This issue is probably related to https://rails.lighthouseapp.com/projects/8994/tickets/4524-mongrel-under-rails-3-beta-3#ticket-4524-7
any update on this ?
Any patch from there? (no monkey patch, please)
And if you read my previous comment, the solution needs to work with both versions of rails, 3.0 and lower.
Unfortunately no patch just an issue with mongrel trying to access dispatcher which doesn't exist anymore. I can't help notice mongrel_rails fails to start, but rails server seems to start mongrel just fine. I assume it is linked to some kind of monkey patching by rails when starting mongrel, but I don't have details and I can't say I understand the root cause of the issue. The analysis I have seen for the moment assume a larger understanding of both code bases and external options than I have.
Indeed.
Also, the patch shown in previous commits do not work as other stuff has been changed, not just the dispatcher.
rails server works because it start mongrel in a different way.