[Rails-core] Routing a Sinatra application

36 views
Skip to first unread message

Damien MATHIEU

unread,
Apr 23, 2010, 11:15:37 AM4/23/10
to Ruby on Rails: Core
Hello,

I wish to route a sinatra application in my Rails 3 app. As said by
Yehuda, it should be possible.
http://yehudakatz.com/2009/12/26/the-rails-3-router-rack-it-up/

However I see the route isn't recognized and I get
ActionController::RoutingError problems.
It works well with simple rack apps however (the test in actionpack
with a lambda passes well).

I've written a test case which fails. But I couldn't reproduce it
without sinatra.
http://gist.github.com/376653
If you have any more luck than me, I'm all hears.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-co...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.

Mislav Marohnić

unread,
Apr 23, 2010, 11:56:17 AM4/23/10
to rubyonra...@googlegroups.com
I can confirm that this is true. The `recognize_path` lookup failed not because it couldn't find '/nested_application', but because it found it and failed on `route.app.is_a?(Dispatcher)` lookup. `route.app` returns Sinatra::ShowExceptions, which is the first Sinatra middleware on the stack that's unique to Sinatra.

I would suspect that this bug is in Rack::Mount, not Rails, but I'm not sure. (I've only poked around for a couple of minutes.)

Damien MATHIEU

unread,
Apr 26, 2010, 8:59:08 AM4/26/10
to Ruby on Rails: Core
FYI I've created a ticket about that on LightHouse.
https://rails.lighthouseapp.com/projects/8994/tickets/4478-impossibility-to-mount-a-sinatra-app
> > rubyonrails-co...@googlegroups.com<rubyonrails-core%2Bunsu...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/rubyonrails-core?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-co...@googlegroups.com.
> For more options, visit this group athttp://groups.google.com/group/rubyonrails-core?hl=en.
Reply all
Reply to author
Forward
0 new messages