Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined method `connect' for Redis:Class #99

Open
DependencyHell opened this issue Oct 17, 2017 · 5 comments
Open

undefined method `connect' for Redis:Class #99

DependencyHell opened this issue Oct 17, 2017 · 5 comments

Comments

@DependencyHell
Copy link

DependencyHell commented Oct 17, 2017

Hi,

I just installed it with gem, but I've got this after starting with gem redmon

Thin web server (v1.7.2 codename Bachmanity)
Maximum connections set to 1024
Listening on 0.0.0.0:4567, CTRL+C to stop
[17-10-17 11:08:04] listening on http://0.0.0.0:4567/
[17-10-17 11:08:14] !!! Redmon has shit the bed, restarting... undefined method `connect' for Redis:Class
[17-10-17 11:08:14] /var/lib/gems/2.3.0/gems/redmon-0.0.13/lib/redmon/redis.rb:18:in `redis'
[17-10-17 11:08:14] /var/lib/gems/2.3.0/gems/redmon-0.0.13/lib/redmon/worker.rb:13:in `record_stats'
[17-10-17 11:08:14] /var/lib/gems/2.3.0/gems/redmon-0.0.13/lib/redmon/worker.rb:7:in `block in run!'
[17-10-17 11:08:14] /var/lib/gems/2.3.0/gems/eventmachine-1.2.5/lib/em/timers.rb:56:in `fire'
[17-10-17 11:08:14] /var/lib/gems/2.3.0/gems/eventmachine-1.2.5/lib/eventmachine.rb:194:in `call'
[17-10-17 11:08:14] /var/lib/gems/2.3.0/gems/eventmachine-1.2.5/lib/eventmachine.rb:194:in `run_machine'
[17-10-17 11:08:14] /var/lib/gems/2.3.0/gems/eventmachine-1.2.5/lib/eventmachine.rb:194:in `run'
[17-10-17 11:08:14] /var/lib/gems/2.3.0/gems/redmon-0.0.13/lib/redmon.rb:20:in `start_em'
[17-10-17 11:08:14] /var/lib/gems/2.3.0/gems/redmon-0.0.13/lib/redmon.rb:9:in `run'
[17-10-17 11:08:14] /var/lib/gems/2.3.0/gems/redmon-0.0.13/bin/redmon:84:in `<top (required)>'
[17-10-17 11:08:14] /usr/local/bin/redmon:23:in `load'
[17-10-17 11:08:14] /usr/local/bin/redmon:23:in `<main>'

What am I missing?

Redis server v=3.0.6 sha=00000000:0 malloc=jemalloc-3.6.0 bits=64 build=687a2a319020fa42

Thanks

@lavaturtle
Copy link

I think this is a version dependency issue. We started seeing this error when we upgraded the redis gem from 3.3.5 to 4.0.1. Rolling redis back to 3.3.5 fixed the issue for us.

@xulongju
Copy link

xulongju commented Dec 5, 2017

Hi :
I installed redmon the same problem:
Thin web server (v1.7.2 codename Bachmanity)
Maximum connections set to 1024
Listening on 0.0.0.0:4567, CTRL + C to stop
[17-12-05 15:00:45] listening on http://0.0.0.0:4567/
[17-12-05 15:00:55] !!! Redmon has shit the bed, restarting ... undefined method connect 'for Redis: Class [17-12-05 15:00:55] /usr/local/rvm/gems/ruby-2.4.1/gems/redmon-0.0.13/lib/redmon/redis.rb:18:in redis'
[17-12-05 15:00:55] /usr/local/rvm/gems/ruby-2.4.1/gems/redmon-0.0.13/lib/redmon/worker.rb:13:in record_stats' [17-12-05 15:00:55] /usr/local/rvm/gems/ruby-2.4.1/gems/redmon-0.0.13/lib/redmon/worker.rb:7:in block in run !
[17-12-05 15:00:55] /usr/local/rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.5/lib/em/timers.rb:56:in fire ' [17-12-05 15:00:55] /usr/local/rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.5/lib/eventmachine.rb:194:in call '
[17-12-05 15:00:55] /usr/local/rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.5/lib/eventmachine.rb:194:in run_machine ' [17-12-05 15:00:55] /usr/local/rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.5/lib/eventmachine.rb:194:in run '
[17-12-05 15:00:55] /usr/local/rvm/gems/ruby-2.4.1/gems/redmon-0.0.13/lib/redmon.rb:20:in start_em ' [17-12-05 15:00:55] /usr/local/rvm/gems/ruby-2.4.1/gems/redmon-0.0.13/lib/redmon.rb:9:in run '
[17-12-05 15:00:55] /usr/local/rvm/gems/ruby-2.4.1/gems/redmon-0.0.13/lib/redmon.rb:15:in rescue in run ' [17-12-05 15:00:55] /usr/local/rvm/gems/ruby-2.4.1/gems/redmon-0.0.13/lib/redmon.rb:8:in run '

Version:
Install redmon using the gem in ruby-2.4.1
redis: 2.8.22

Please help me check the problem, thank you.

@xulongju
Copy link

xulongju commented Dec 6, 2017

Already solved, Redis 4.0.1 downgraded to 3.3.5

@amatriain
Copy link
Contributor

This error happens with redis gem versions from 4.0 onward. This is caused by the removal of the Redis#connect method, which was deprecated long ago. The fix is to use Redis#new instead, which is a straightforward replacement (#connect was just a wrapper around #new).

The commit in redis that removed #connect was redis/redis-rb@895cc32#diff-54fab56a3b12825ac3ed9243b67fd459

That commit is over two years old. It's not acceptable being stuck with such an old redis.rb version.

I've added a PR that fixes this. #101

@romulogoncalves
Copy link

Are we still locked to an old version of Redis?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants