mongrel
mongrel copied to clipboard
Racked
Hello,
I have modified mongrel to support rack instead of obsolete CGI. This means that mongrel_rails command should work with newer Rails 2 and Rails 3.
However, I have removed the reload functionality which could be originally triggered by HUP signal. Also, there is not possible to mount the application with some prefix, since I have not found way how to achieve this with Rails 3.
Hello,
Hell of a work you started here! :-)
I believe there is a way to mount Rails 3 applications in prefix using Rack. There is some article about usage of Rack::Mount
http://inductor.induktiv.at/blog/2010/05/23/mount-rack-apps-in-rails-3/
Which I believe is backed by this:
https://github.com/josh/rack-mount
And rack-mount seems to be part of Rails 3 gem dependency (via actionpack)
https://rubygems.org/gems/actionpack
We can introduce that dependency for Rails 3 users and alternatively make --prefix optional if rack-mount is found.
Thoughts?
I dug into this issue little bit more and the option --path which was available for Rails 2 was apparently removed for Rails 3.0. The question is how to solve this in mongrel, since it seems that in Rails 3 there is no other way how to mount application with prefix then use routes file.
I see two options:
- Remove the option completely
- Support it just for Rails 2, with warning "this option is deprecated/ignored" for Rails 3
I am personally for removing this option, since even during Rails 2 there were some changes in functionality which were not reflected by mongrel, i.e. change from ActionController::AbstractRequest.relative_url_root to ActionController::Base.relative_url_root and there are left some issues anyway [1]. So if somebody really wants to mount application with prefix, I would suggest to use routes file anyway.
[1] https://rails.lighthouseapp.com/projects/8994/tickets/2429
How about follow the first point, merge this and release something like mongrel-2.0.0-beta? Supporting just rails 2.3 and 3. Or even just rails 3?