redis-trib.rb创建Redis集群时失败报错解决方案
问题描述:
[ init.d]# redis-trib.rb create --replicas 1 192.168.1.110:7001 192.168.1.110:7002 192.168.1.112:7003 192.168.1.112:7004 192.168.1.113:7005 192.168.1.113:7006 /usr/local/ruby/lib/ruby/gems/2.3.0/gems/redis-3.3.0/lib/redis/client.rb:15:in `<class:Client>‘: undefined local variable or method `redis‘ for Redis::Client:Class (NameError) from /usr/local/ruby/lib/ruby/gems/2.3.0/gems/redis-3.3.0/lib/redis/client.rb:6:in `<class:Redis>‘ from /usr/local/ruby/lib/ruby/gems/2.3.0/gems/redis-3.3.0/lib/redis/client.rb:5:in `<top (required)>‘ from /usr/local/ruby/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require‘ from /usr/local/ruby/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require‘ from /usr/local/ruby/lib/ruby/gems/2.3.0/gems/redis-3.3.0/lib/redis.rb:2771:in `<top (required)>‘ from /usr/local/ruby/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `require‘ from /usr/local/ruby/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `rescue in require‘ from /usr/local/ruby/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require‘ from /usr/local/bin/redis-trib.rb:25:in `<main>‘
解决方案:
检查client.rb的配置是否配置正确。
vim /usr/local/rvm/gems/ruby-2.3.3/gems/redis-4.0.0/lib/redis/client.rb,
class Client DEFAULTS = { :url => lambda { ENV["REDIS_URL"] }, :scheme => "redis", :host => "127.0.0.1", :port => 6379, :path => nil, :timeout => 5.0, :password => "passwd123", :db => 0, :driver => nil, :id => nil, :tcp_keepalive => 0, :reconnect_attempts => 1, :inherit_socket => false }
相关推荐
王道革 2020-11-25
wangdonghello 2020-11-03
Langeldep 2020-11-16
chenhualong0 2020-11-16
聚合室 2020-11-16
koushr 2020-11-12
MRFENGG 2020-11-11
guoyanga 2020-11-10
fackyou00 2020-11-10
Orangesss 2020-11-03
dongCSDN 2020-10-31
rainandtear 2020-10-30
Quietboy 2020-10-30
liuyulong 2020-10-29
fansili 2020-10-29
温攀峰 2020-10-23
jackbon 2020-10-19
kaixinfelix 2020-10-04