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.

Rails 2.3 + Mongrel: Deploy with --prefix causes AbstractRequest Error

#2319

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

Reported by Peter Leonhardt · March 23rd, 2009 @ 10:54 PM

State: invalid
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Peter Leonhardt
    Peter Leonhardt

    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@@@

    March 23rd, 2009 @ 10:56 PM

  2. Peter Leonhardt
    Peter Leonhardt

    please ignore the above comment, I edited the original with the proper code blocks. Thanks

    March 23rd, 2009 @ 10:58 PM

  3. Peter Leonhardt
    Peter Leonhardt
    • Tag changed from 2.3, abstractrequest, mongrel to 2.3, abstractrequest, bug, mongrel

    March 26th, 2009 @ 12:54 AM

  4. Christian Nolte
    Christian Nolte

    This happens with thin 1.0.0 as well

    April 2nd, 2009 @ 04:21 PM

  5. Christian Nolte
    Christian Nolte

    BTW: The mentioned workaround has to be made in config/initializers. Thanks for the workaround though!

    April 2nd, 2009 @ 04:22 PM

  6. Pratik
    Pratik
    • State changed from new to invalid

    It's a mongrel issue.

    May 16th, 2009 @ 05:49 PM

  7. bingbing
  8. hanlyrai
    hanlyrai

    AVI to iPone converter AVI to iPhone is able to convert AVI video files to proper video files that are supported by iPod.

    April 15th, 2011 @ 10:09 AM