This project is archived and is in readonly mode.
Rails 2.3 + Mongrel: Deploy with --prefix causes AbstractRequest Error
Reported by Peter Leonhardt | March 23rd, 2009 @ 10:54 PM | in 2.x
Hey guys,
I think this is more of a mongrel problem, but seeing as how that hasn't had an update in a year, I'm wondering if we can fix this on the rails side.
Using mongrel_rails start --prefix /something
now breaks, because on line 151 of mongrel/rails.rb reads
ActionController::AbstractRequest.relative_url_root = ops[:prefix] if ops[:prefix]
Since AbstractRequest has been removed, this throws a "undefined constant ActionController::AbstractRequest" error. And relative_url_root is now on ActionController::Base
I've worked around it by adding:
module ActionController
class AbstractRequest < ActionController::Request
def self.relative_url_root=(path)
ActionController::Base.relative_url_root=(path)
end
def self.relative_url_root
ActionController::Base.relative_url_root
end
end
end
to my /lib directory in my 2.3.2.1 apps
Not sure if you guys want to allow the backward compatibility or not, but wanted to bring the problem to your attention.
Thanks
Comments and changes to this ticket
-
Peter Leonhardt March 23rd, 2009 @ 10:56 PM
Sorry, that code should look like:
line 151 of mongrel/rails.rb reads
ActionController::AbstractRequest.relative_url_root = ops[:prefix] if ops[:prefix]@@@
module ActionController class AbstractRequest < ActionController::Request
def self.relative_url_root=(path) ActionController::Base.relative_url_root=(path) end def self.relative_url_root ActionController::Base.relative_url_root end
end end@@@
-
Peter Leonhardt March 23rd, 2009 @ 10:58 PM
please ignore the above comment, I edited the original with the proper code blocks. Thanks
-
Peter Leonhardt March 26th, 2009 @ 12:54 AM
- Tag changed from 2.3, abstractrequest, mongrel to 2.3, abstractrequest, bug, mongrel
-
Christian Nolte April 2nd, 2009 @ 04:22 PM
BTW: The mentioned workaround has to be made in config/initializers. Thanks for the workaround though!
-
hanlyrai April 15th, 2011 @ 10:09 AM
AVI to iPone converter AVI to iPhone is able to convert AVI video files to proper video files that are supported by iPod.
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>