【问题标题】:NOAUTH Authentication required redisNOAUTH 需要认证 redis
【发布时间】:2016-01-19 14:20:30
【问题描述】:

启动redis-server

redis-server /usr/local/etc/redis.conf

Redis 配置文件(/usr/local/etc/redis.conf):

... 
requirepass 'foobared'
...

Rails - application.yml

...
development:
  redis_password: 'foobared
...

错误

Redis::CommandError - NOAUTH Authentication required.:
...
app/models/user.rb:54:in `last_accessed_at' 
...

app/models/user.rb:54

Line 53 - def last_accessed_at
Line 54 -  Rails.cache.read(session_key)
Line 55 - end

session_key只是User模型的一个属性。

顺便说一句:

± ps -ef | grep redis
  501 62491 57789   0  1:45PM ttys001    0:00.37 redis-server 127.0.0.1:6379
  501 62572 59388   0  1:54PM ttys002    0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn redis

【问题讨论】:

  • 您是否忘记告诉我们您在哪里设置了类似 Redis.new(:password => "mysecret") 的密码,或者您是否在 rails 应用程序的某个地方设置了此密码?

标签: ruby-on-rails-4 redis redis-cache redis-server


【解决方案1】:

我遇到了同样的错误:

我刚刚注释掉了 requirepass 行。

# requirepass 'foobared'

它在我的情况下有效。

【讨论】:

猜你喜欢
  • 2021-03-20
  • 2017-07-17
  • 2017-02-18
  • 1970-01-01
  • 2018-01-22
  • 2017-07-13
  • 2019-06-11
  • 2020-02-22
  • 2016-03-10
相关资源
最近更新 更多