Mount a Sinatra app on your Ruby on rails (3) application

Posted on Aug 22, 2011

I have been migrating a Rails 2.3.10 application to Rails 3.0.9, while doing so I also migrated our queue system from delayed_jobs that ripped our system apart to Resque.

Resque comes with a Sintra app to monitor the Queue, see what’s going on and what jobs failed etc.

It’s very convenient and you can really grasp what’s going on with your system. I really missed that in delayed_job (amongst other things).

So, I wanted to mount this Sinatra app onto our rails application.

It turns out to be VERY easy and straight forward.

Just add this to your routes.rb file:

[ruby]

mount Resque::Server, :at => “/resque”

[/ruby]

In an initializer, just require the “resque/server” and you are done!