Resque: Error: undefined method `connect' for Redis:Class (NoMethodError)

Created on 1 Mar 2018  路  4Comments  路  Source: resque/resque

There seems to be a problem when the redis 4.0 gem is installed.

/gems/resque-1.27.4/lib/resque.rb:116:in `redis=': undefined method `connect' for Redis:Class (NoMethodError)

this code:

# test.rb
require 'resque'
ENV['QUEUE'] = '*'
worker = Resque::Worker.new
Resque.redis = 'redis://redis:6379'

Works with no problems with the redis 3.5 gem, but fails with the redis 4.0 gem

In addition to the above test file, I only have this Gemfile, provided here for convenience and quick reproduction:

# Gemfile
source "https://rubygems.org"
gem "resque"

# Does not work with redis 4.0, so we force it
# gem 'redis', '< 4.0'

Most helpful comment

1593 馃憤

All 4 comments

Can you try with the resque master branch? I believe this issue is already fixed.

Tried with resque 2.0.0 (was 1.27.4), and it is indeed fixed, thanks.
Will wait for the release, and in the meantime force redis < 4.0

1593 馃憤

Still having this issue. Works fine in "< 4.0"
gem 'redis', git: 'https://github.com/redis/redis-rb'

bundle install
Using redis 4.0.2 (was 3.3.5) from https://github.com/redis/redis-rb (at master@dda594a)

2.5.1 :001 > Resque.redis = 'redis://localhost:6379'
Traceback (most recent call last):
        1: from (irb):1
NoMethodError (undefined method `connect' for Redis:Class)
Did you mean?  concerning
Was this page helpful?
0 / 5 - 0 ratings