Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Impossibility to mount a Sinatra app

#4478

It's currently impossible to mount any Sinatra application on rails3.
The route is recognized by the rake routes command. But whenever we go to it in the browser or we execute it in the tests, we get a ActionController::RoutingError exception.

I've written a test case that reproduces it (but as I didn't succeed to reproduce it without Sinatra, it includes the framework. So it's not committable to rails).
http://gist.github.com/376653

A few days ago, I posted about it in Rails: Core. Mislav has already given some suppositions about it.
http://groups.google.com/group/rubyonrails-core/browse_thread/threa...

Reported by Damien MATHIEU · April 26th, 2010 @ 12:54 PM

State: invalid
Milestone: 3.0.2
Assigned to: nobody
Importance: Low

Activity

  1. Damien MATHIEU
    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.

    May 25th, 2010 @ 04:47 PM

  2. José Valim
    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)!

    June 17th, 2010 @ 01:28 PM

  3. Jeremy Kemper
    Jeremy Kemper
    • Milestone set to 3.0.2
    • Importance changed from to Low

    October 15th, 2010 @ 11:01 PM