Resque is really great. It’s super easy to set up, (pretty) well documented, and damn fast. I’ve set it up for two — going on three — projects here and I’ve gotten stuck on two points twice now.

Add the Resque tasks to your Rakefile

Herp derp. I have no idea how I missed this twice. Make sure you include the rake tasks in your rake file by adding


require 'resque/tasks'

to the top of your Rakefile. If you don’t rake won’t know how to start the Resque worker.


/www/integrand [ master* ] $ QUEUE=* rake resque:work
(in /www/integrand)
rake aborted!
Don't know how to build task 'resque:work'

(See full trace by running task with --trace)

Add a script to start your Resque worker

The syntax to start Resque workers is (marginally) verbose. Make your life easier by adding a script to your script folder. All you really need is the following:


QUEUE=* VVERBOSE=1 rake environment resque:work

The VVERBOSE argument, not suprisingly, tells Resque to use very verbose logging to the console. The “environment” argument has Resque load the full Rails¬†environment (read: Your models!)¬†for it’s jobs.