Ruby on Rails中使用Redis时,如何解决ERR set命令参数数量错误的问题?
- 内容介绍
- 文章标签
- 相关推荐
本文共计208个文字,预计阅读时间需要1分钟。
这个Redis命令`redis.set(test, true, ex: 24.hours)`返回异常,提示错误信息ERR wrong number of arguments for 'set' command。这通常是因为命令的参数数量或类型不正确。
以下是修改后的代码,确保参数数量和类型正确,且不超过100个字:
Redis命令格式错误:`redis.set(test, true, ex: 24.hours)` 返回异常。错误信息为ERR wrong number of arguments for 'set' command。请检查Redis命令的参数数量和类型是否正确。
为什么这个代码redis.set("test", true, ex: 24.hours)
返回以下异常?
Redis::CommandError: ERR wrong number of arguments for 'set' command
我用这些宝石
> redis(3.2.0)
> redis-rails(4.0.0)
本文共计208个文字,预计阅读时间需要1分钟。
这个Redis命令`redis.set(test, true, ex: 24.hours)`返回异常,提示错误信息ERR wrong number of arguments for 'set' command。这通常是因为命令的参数数量或类型不正确。
以下是修改后的代码,确保参数数量和类型正确,且不超过100个字:
Redis命令格式错误:`redis.set(test, true, ex: 24.hours)` 返回异常。错误信息为ERR wrong number of arguments for 'set' command。请检查Redis命令的参数数量和类型是否正确。
为什么这个代码redis.set("test", true, ex: 24.hours)
返回以下异常?
Redis::CommandError: ERR wrong number of arguments for 'set' command
我用这些宝石
> redis(3.2.0)
> redis-rails(4.0.0)

