librelist archives

« back to archive

Resque in Rails 3

Resque in Rails 3

Sam Granieri
2010-04-29 @ 19:40
I've figured out how to integrate Resque into a Rails 3 application
easily. Here's how:

First, install json and resque in your gemfile,

Then, put either one of these in your routes file (They both do the same thing)

mount, :at => "/resque"
(which converts to)
match "/resque", :to=>, :anchor => false

You can stick this in the routes file or in config/initializers/resque.rb

require 'resque/server'
Resque::Server.use Rack::Auth::Basic do |username, password|
  username == YOUR_USERNAME
  password == YOUR_PASSWORD

Another note: As it stands now, Passenger will treat a rails 3 app
with at the top level as a Rack application (without memory
savings). If you remove , it'll be recognized as a rails
application and most importantly the routes above will still work.

Or you could just use unicorn :)

-- Sam Granieri