I start a worker with:
rake environment resque:work RAILS_ENV=development VVERBOSE=1 QUEUE=* LOGFILE=/Users/matteo/workspace/APP/log/resque.log --trace
I get the output:
** Invoke environment (first_time)
** Execute environment
** Invoke resque:work (first_time)
** Invoke resque:preload (first_time)
** Invoke resque:setup (first_time)
** Execute resque:setup
** Execute resque:preload
** Invoke resque:setup
** Execute resque:work
A quick ps tells me the process is up and running.
Now I do NOT have an instance of Redis running. A quick ps auxwwww | grep redis-server confirms that.
Shouldn’t the worker fails?
I downloaded the resque code and put a breakpoint into the resque code in worker.rb:
(rdb:1) eval redis
#<Redis::Namespace:0x007f868cb57880 @namespace=:resque, @redis=#<Redis client v2.2.2 connected to redis://127.0.0.1:6379/1 (Redis v0.07)>>
How is this possible nothing is running on that port?
Thanks for any help
The answers is: “No, workers cannot run without a copy of Redis running”.
The problem was caused by the fakeredis gem. Even though the gem was not included in the development environment the developer was requiring “redis/connction/memory” therefore using a fakeredis instance.