This project is archived and is in readonly mode.
an RoutingError of prefix path
Reported by richy zhang | November 1st, 2008 @ 02:13 AM
The newest Rails 2.2rc1 seems to have a routing error if it's used with a URL prefix.
After creating a new app named msp, if I used the command
ruby script/server
or
mongrel_rails start
to start the app, everything is well. But, when I used the command
mongrel_rails start --prefix /msp
an ActionController::RoutingError raised and the log report
ActionController::RoutingError (No route matches "/msp/users/1" with {:method=>:get}):
/usr/local/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.0/lib/action_controller/routing/recognition_optimisation.rb:66:in `recognize_path'
/usr/local/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.0/lib/action_controller/routing/route_set.rb:385:in `recognize'
/usr/local/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.0/lib/action_controller/dispatcher.rb:179:in `handle_request'
When it's deployed to the phusion passenger, the result is almost same.
Comments and changes to this ticket
-
Michael Koziarski November 2nd, 2008 @ 09:18 AM
Which version of mongrel do you have installed? The code appears to be correct in 1.1.5?
-
Michael Koziarski November 2nd, 2008 @ 09:18 AM
- Milestone cleared.
- Assigned user set to Michael Koziarski
We may need to add a work around for this before 2.2 final. Or provide patches upstream as needed
-
richy zhang November 2nd, 2008 @ 11:32 AM
I use mongrel (1.1.5). The routing error raises only when mongrel is start with the opinion --prefix /msp . Without the opinion, I don't find any problems.
Now I put ENV['RAILS_RELATIVE_URL_ROOT']="/msp" in the environment.rb as Hongli Lai suggested, and msp can be deployed to passenger.
-
Michael Koziarski November 2nd, 2008 @ 12:14 PM
I've applied this patch as of 8a53e25
You should be able to freeze to edge and it should all work, alternatively that patch should apply cleanly to your rc1 checkout.
-
Michael Koziarski November 2nd, 2008 @ 12:14 PM
- State changed from new to committed
-
richy zhang November 3rd, 2008 @ 01:18 AM
I find out that "ActionController::base.relative_url_root=relative_url_root" should be ::Base.
In the other hand, it works well with 'mongrel_rails start --prefix="/msp" ' , but it's broken with phusion passenger even if I provide ENV['RAILS_RELATIVE_URL_ROOT'].
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>