Find file
Fetching contributors…
Cannot retrieve contributors at this time
78 lines (56 sloc) 2.51 KB


A Moonshine plugin for installing and managing resque.

Rails 2 Installation

script/plugin install git://
script/plugin install git://
script/generate moonshine_resque

Rails 3 Installation

script/plugin install git://
script/rails g moonshine_resque --with-god


  • Configure settings in your moonshine.yml (Or use configure() in manifest as usual)

  • Add this to the end of your Rakefile:

    # Rails 2 only, Rails 3 does it for you in lib/tasks/resque_tasks.rake require 'resque/tasks'

  • Include the recipes in your Moonshine manifest

    recipe :redis # requires moonshine_redis recipe :resque recipe :resque_web # optional recipe :god # optional, requires moonshine_god to monitor Resque with god

Resque Web Interface

Resque Web Interface can be configured with the following options in your moonshine.yml:

    :username: resque     # default none
    :password: sekrit     # default none
    :port: 5678           # default 8282

The web interface settings will be used to create the VirtualHost and for the Sinatra application included with Resque. You can access the web interface from your domain and the port,

Monitor Resque with God

Generate the configuration file and install the Moonshine_God plugin:

# Rails 2
script/generate moonshine_resque_god
script/plugin install git://
# Rails 3
script/rails g moonshine_resque --with-god=true

Modify the configuration file (config/god/resque.god) as needed.

You'll also want to add the `:resque` role to all servers using it. For example:

# config/deploy/production.rb
server '', :app, :resque

If you're using Resque with God this way, you also have access to some Capistrano tasks:

cap god:resque:restart # restart resque
cap god:resque:start   # start resque
cap god:resque:stop    # stop resque
cap god:resque:status  # show status of resque

We also strongly recommend having Moonshine automatically restart Resque on deploys:

# config/deploy.rb
before 'god:restart', 'god:resque:stop'

This is a great way to handle automatically reloading new app code into your workers on deploy, as well as increasing or decreasing the number of Resque workers.