1
votes

In rails, it is easy to just add a config/resque.yml, but we're running a gem on the command line and we would like to tell it where to look for Resque jobs instead of the default localhost:6379

Right now, we run our gem by going to the gem lib and then running rake resque:work etc etc.. so how do we tell it where redis is?(redis could be in another machine in the network or in the cloud)

2

2 Answers

1
votes

Building on corroded's answer, I had to do this:

require "./my_class"
require "resque"
Resque.redis = 'server:port'
require "resque/tasks"
0
votes

We fixed this by just adding Resque.redis = 'server:port in our gem's Rakefile, just before we included resque via require 'resque/tasks'