No route matches "/redmine/public/"

Added by Eric Voisard over 13 years ago

Dear All,

I'm trying to upgrade to 0.9.2 (redmine-0.9.2.tar.gz) one of two Redmine 0.8.4 installs that are running on the same Linux server with Apache/2.2.3 + mod_fcgi. One is actually used in production and one is for doing tests. So far, both were in different subdirectories on the server and both were working.

Now that I've managed to install 0.9.2 on the second one, that one doesn't work anymore. In production.log there is:

Processing ApplicationController#index (for at 2010-02-17 15:49:29) [GET]

ActionController::RoutingError (No route matches "/redmine/public/" with {:method=>:get}):

Rendering /srv/www/htdocs/redmine/public/404.html (404 Not Found)

I've read a couple of discussions such as
Redmine in a subdirectory
Lighttpd+fcgi+sub-URI=500-Internal Server Error
Defect #2894

And I have tried changes like this in environment.rb:

Redmine::Utils::relative_url_root = "/redmine" 
ActionController::Base.relative_url_root = "/redmine" 

as explained in HowTo_Install_Redmine_in_a_sub-URI, or

config.action_controller.relative_url_root = "/redmine" 

But no way, I keep getting such RoutingError messages...

Was this subdirectory issue predating 0.8.4? How is it that I didn't have problems with 0.8.4? I'm getting nowhere and I'm short with ideas so if anybody knows the required magic spell, please tell me...

Thanks, Eric

PS: I've read the installation/upgrade procedures, etc...

Replies (5)

RE: No route matches "/redmine/public/" - Added by Brandon Dixon over 13 years ago

I too am getting the same error. I was able to make it work by putting the config.action_controller.relative_url_root = "/ticketing"
in the environment file. The application now loads, but I am not able to submit anything without getting some crazy passenger error:

Error during failsafe response: closed stream
[Wed Feb 17 17:31:41 2010] [error] [client] Premature end of script headers: login, referer: https://
[ pid=9237 file=Hooks.cpp:514 time=2010-02-17 17:31:41.290 ]:
  Backend process 9446 did not return a valid HTTP response. It returned: [Status]
*** Exception NoMethodError in application (undefined method `[]=' for nil:NilClass) (process 9446):
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/rack/request_handler.rb:68:in `process_request'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/abstract_request_handler.rb:197:in `main_loop'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/railz/application_spawner.rb:340:in `start_request_handler'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/railz/application_spawner.rb:298:in `handle_spawn_application'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/utils.rb:176:in `safe_fork'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/railz/application_spawner.rb:296:in `handle_spawn_application'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/abstract_server.rb:332:in `__send__'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/abstract_server.rb:332:in `main_loop'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/abstract_server.rb:182:in `start_synchronously'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/abstract_server.rb:149:in `start'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/railz/application_spawner.rb:192:in `start'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/spawn_manager.rb:260:in `spawn_rails_application'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/abstract_server_collection.rb:121:in `lookup_or_add'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/spawn_manager.rb:254:in `spawn_rails_application'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/abstract_server_collection.rb:75:in `synchronize'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/abstract_server_collection.rb:74:in `synchronize'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/spawn_manager.rb:253:in `spawn_rails_application'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/spawn_manager.rb:148:in `spawn_application'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/spawn_manager.rb:285:in `handle_spawn_application'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/abstract_server.rb:332:in `__send__'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/abstract_server.rb:332:in `main_loop'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.1.2/lib/phusion_passenger/abstract_server.rb:182:in `start_synchronously'
        from /usr/lib/ruby/gems/1.8/gems/passenger-2.1.2/bin/passenger-spawn-server:50

Completely stuck.

RE: No route matches "/redmine/public/" - Added by Felix Schäfer over 13 years ago

Brandon, please don't spill yourself over different topics, that makes it effectively harder to help you.

Eric, Have you restarted/reloaded all the necessary processes after the upgrade? Also please make sure you have the right ruby/rails version installed and activated.

RE: No route matches "/redmine/public/" - Added by Eric Voisard over 13 years ago

Felix, yes I did restart my httpd each time I tried a change. As for versions, this was the subject of my previous post which version of Rails is used... . Since I installed a release package, the correct version of Rails was bundled.

But I've made progresses:

so far, I only tried to access Redmine with an URL in the form

Today, I've created an alias pointing to the redmine/public directory in my Apache config file:

Alias /rm/ "/srv/www/htdocs/redmine/public/" 

In conjunction with the following addition in environment.rb:


I'm not sure why, but it worked!

Among others, yesterday I tried to use an alias but it was failing. I guess it was not the correct combination of changes...

Brandon, I don't think your actual problem is related to relative url resolution. Imho, it works or it doesn't, and if your application loads then you indeed fixed your relative url problem. I'd focus on Passenger...

Regards, Eric

RE: No route matches "/redmine/public/" - Added by Felix Schäfer over 13 years ago

Eric, I think you mixed some things up :-)

You seem to have installed the whole of redmine into your htdocs directory, that is not necessary (at least not with passenger, don't know about fcgi) and might even be a security issue. Rails doesn't work as say php or others, where a php file generates some html, but rails runs a rails application, which can sit anywhere, not necessarily in your htdocs. The public directory in a rails program contains static assets that the webserver needs to know about though, that's what happened when you made the alias.

A concrete case with passenger (shouldn't be too different with fcgi): I would usually put applications that don't need to reside in the htdocs in a different folder, say for redmine /srv/www/applications/redmine, and make a symlink from the suburi I want redmine on to the public directory of the application, in this example /srv/www/htdocs/rm would point to ../applications/redmine/public/, after that you just point fcgi to /srv/www/applications/redmine, and should be good (no need for the apache Alias here obviously). Think of rails not as a "web application" that resides in your "web" folder, but as a middleware that's controlled by your webserver and for which the application can reside anywhere you like (save for the public directory).

RE: No route matches "/redmine/public/" - Added by Eric Voisard over 13 years ago

I see the point with what you say, there are some perl web apps that are similar.
When I first installed Redmine I had no clue about Ruby, Rails and all that. As I was not sure how it would work and as security is not an issue on this server I've put everything in the web root. It was easier.
But now is a good opportunity to rearrange things how they should be. I'll follow your advices, right now...

Many thanks for your input