我已将ruby redis客户端升级到3.0.7.然后这个方法在我的localhost上工作
[5] pry(main)> $redis.scan(0, :match => "restrict*") [ [0] "5", [1] [ [0] "restrict_3", [1] "restrict_2" ] ]
但是在我的远程服务器上它失败了(就像它在升级之前在localhost上失败)
2.0.0p247 :001 > $redis.scan(0, :match => "question*") Redis::CommandError: ERR unknown command 'scan' from /usr/local/rvm/gems/ruby-2.0.0-p247@my_app/gems/redis-3.0.7/lib/redis/client.rb:97:in `call'
任何想法为什么?
编辑:这是输出 bundle show redis
localhost /Users/ohad/.rvm/gems/ruby-2.0.0-p247@my_app/gems/redis-3.0.7 remote /usr/local/rvm/gems/ruby-2.0.0-p247@app/gems/redis-3.0.7
编辑:问题已解决.redis(服务器,而不是ruby客户端)是2.6,应该更高.
答案是远程服务器正在运行Redis服务器v2.6.
SCAN
虽然加入了2.8.