This project is archived and is in readonly mode.
Impossibility to mount a Sinatra app
-
Damien MATHIEU
- Tag changed from rack, rack-mount, rails3, routes, sinatra to feature_request, rack, rack-mount, rails3, routes, sinatra
Rizwan Reza has published a repository showing that in fact, it works : http://github.com/rizwanreza/sinatra-rails
Indeed, like that, it does.So I guess that's not really a bug but an improvement.
In Rizwan's example, the Sinatra app is mounted in the "/sinatra" directory. And it does gets on /.
This requires any Sinatra mounted application to be aware of the directory in which it'll be mounted. And if we change this directory, we need to also change all the routes in the sinatra app.Moreover, it forbids us to mount external apps without updating them.
For example if I wanted to mount the resque's web app in the "/resque" directory, I couldn't without updating the sinatra app in the gem. -
José Valim
- Milestone cleared.
- State changed from new to invalid
Damien, this is actually a Sinatra bug. According to the rack specification, env["PATH_INFO"] could be an empty string but Sinatra is not behaving properly when it sees one.
Please see this issue: http://github.com/sinatra/sinatra/issues#issue/13
Have you tried with other routes? I have a sinatra app working here with Rails 3 without problems (except by the ones related in that other ticket)!