2
我已將我的ruby redis客戶端升級到3.0.7。 則此方法在我的本地ruby redis客戶端掃描不工作使用3.0.7
[5] pry(main)> $redis.scan(0, :match => "restrict*")
[
[0] "5",
[1] [
[0] "restrict_3",
[1] "restrict_2"
]
]
,但我的遠程服務器上的工作失敗(像它在本地主機上失敗,在升級之前)
2.0.0p247 :001 > $redis.scan(0, :match => "question*")
Redis::CommandError: ERR unknown command 'scan'
from /usr/local/rvm/gems/[email protected]_app/gems/redis-3.0.7/lib/redis/client.rb:97:in `call'
任何想法,爲什麼?
編輯: 這裏是bundle show redis
localhost
/Users/ohad/.rvm/gems/[email protected]_app/gems/redis-3.0.7
remote
/usr/local/rvm/gems/[email protected]/gems/redis-3.0.7
編輯的輸出: 的問題就解決了。 redis(服務器,而不是ruby客戶端)是2.6,應該更高。
'$ redis.get(「some_key」)'',在遠程服務器中工作嗎?你也可以在你的本地機器上執行'$ bundle show redis-rb'並粘貼輸出? – Agis
您好,感謝您的回覆,我不想使用它,因爲我聽說使用這種方法存在真正的性能問題。 – WebQube
@Agis我不想使用'keys'方法+通過輸出更新問題 – WebQube