为什么这段代码
redis.set("test", true, ex: 24.hours)
返回以下异常?
Redis::CommandError: ERR wrong number of arguments for 'set' command
我使用以下这些宝石(gem)
- redis (3.2.0)
- redis-rails (4.0.0)
为什么这段代码
redis.set("test", true, ex: 24.hours)
返回以下异常?
Redis::CommandError: ERR wrong number of arguments for 'set' command
我使用以下这些宝石(gem)
上面的回答是正确的。你需要更新Redis。如果你使用的是Mac电脑,请按照以下步骤快速更新Redis:
$ make
$ make install
如果你正在运行旧版本的Redis,需要将其停止:
$ ps -ef | grep redis
,PID是第一行第二个数字sudo kill <the PID>
就这样了。
sudo pkill redis
- Kirby