ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

Prefix parameter of thin is not working (Bug #849)


Added by Yuriy Cherniavsky at 2012-01-26 08:21 pm. Updated at 2012-02-06 10:14 pm.


Status:Closed Start date:2012-01-26
Priority:Normal Due date:
Assignee:Holger Just % Done:

0%

Category:Libraries
Target version:2.7.0
Remote issue URL: Affected version:2.6.0

Description

If thin runs with '/' value of prefix parameter then everithing work perfect.
If thin runs with for example '/prefix' value of prefix parameter then exception occur:

Processing ApplicationController#index (for XXX.XXX.XXX.XXX at 2012-01-26 20:14:13) [GET]

ActionController::RoutingError (No route matches "/prefix" with {:method=>:get}):
  thin (1.3.1) lib/thin/connection.rb:80:in `pre_process'
  thin (1.3.1) lib/thin/connection.rb:78:in `catch'
  thin (1.3.1) lib/thin/connection.rb:78:in `pre_process'
  thin (1.3.1) lib/thin/connection.rb:53:in `process'
  thin (1.3.1) lib/thin/connection.rb:38:in `receive_data'
  eventmachine (0.12.10) lib/eventmachine.rb:256:in `run_machine'
  eventmachine (0.12.10) lib/eventmachine.rb:256:in `run'
  thin (1.3.1) lib/thin/backends/base.rb:61:in `start'
  thin (1.3.1) lib/thin/server.rb:159:in `start'
  thin (1.3.1) lib/thin/controllers/controller.rb:86:in `start'
  thin (1.3.1) lib/thin/runner.rb:185:in `send'
  thin (1.3.1) lib/thin/runner.rb:185:in `run_command'
  thin (1.3.1) lib/thin/runner.rb:151:in `run!'
  thin (1.3.1) bin/thin:6
  /home/pm/.rvm/gems/ruby-1.8.7-p352@chiliproject/bin/thin:19:in `load'
  /home/pm/.rvm/gems/ruby-1.8.7-p352@chiliproject/bin/thin:19

Rendering /home/pm/chiliproject/public/404.html (404 Not Found)

This bug reproduce under release-v2.6.0 brunch, under release-v2.4.0 brunch everithing work as expected with and without prefix parameter.


relative_url_root.diff (475 Bytes) Holger Just, 2012-01-29 06:53 pm


Associated revisions

Revision be4d679d
Added by Holger Just at 2012-01-29 09:47 pm

[#849 #789] Remove config.ru as Rails 2.3 doesn work well as a rack-only app

Revision 6fd9bc49
Added by Holger Just at 2012-02-06 10:50 pm

[#849 #789] Remove config.ru - Backport for 2.7

Rails 2.3 doesn't work well as a rack-only app

History

Updated by Holger Just at 2012-01-26 08:22 pm

  • Target version deleted (2.7.0)
  • Affected version set to 2.6.0

Updated by Holger Just at 2012-01-26 09:06 pm

This is a bug which was is caused by the introduction of the config.ru file for #789.

A quick workaround for thin is to use --adapter rails and to thus force it into rails mode instead of rack mode. That said, I'm trying to fix it for the next release.

Updated by Holger Just at 2012-01-29 06:53 pm

I'm about to remove the whole config.ru file (and re-open #789). It causes too much trouble with Rails 2.3. Besides this issue there's also a problem of routing. If a request isn't matched by a route, an exception is thrown that can't easily be handled by any controller. Rails 3.1 and above do some magic in their dispatcher there. But I wouldn't want to re-implement this.

Thus, I think the most sensible cause of action id to son't supply a rack-only mode until we have move up to Rails >= 3.1.

That said, this immediate issue can be fixed with a simple dispatcher class in config.ru. A patch can be found in the attachment.

  • Target version set to 3.0.0
  • Assignee set to Holger Just
  • Category set to Libraries
  • File relative_url_root.diff added

Updated by Holger Just at 2012-01-29 08:47 pm

  • Status changed from Open to Closed

Updated by Holger Just at 2012-02-06 10:14 pm

I backported the fix for 2.7. So the numerically first version this is patch is present is 2.7. This is slightly out-of-protocol but I really wanted to have the patch in 2.7.

  • Target version changed from 3.0.0 to 2.7.0

Also available in: Atom PDF