ruby-on-rails – Rails,Sidekiq – Redis NOAUTH

我在rails上使用sidekiq发送电子邮件.我已经为redis服务器添加了密码,但似乎无法正确使用,因为我收到了错误
D,[2015-12-10T16:49:52.714279 #10497] DEBUG -- :    (0.5ms)  COMMIT
I,[2015-12-10T16:49:52.720380 #10497]  INFO -- : [ActiveJob] Enqueued ActionMailer::DeliveryJob (Job ID: 5bce215c-7649-4774-8c6e-d29e743cf25e) to Sidekiq(mailers) with arguments: "MessageMailer","new_message","deliver_Now",gid://customer-app/Message/18
I,[2015-12-10T16:49:52.723400 #10497]  INFO -- : Completed 500 Internal Server Error in 25ms (ActiveRecord: 1.6ms)
F,[2015-12-10T16:49:52.726204 #10497] FATAL -- :
Redis::CommandError (NOAUTH Authentication required.):
  app/controllers/messages_controller.rb:37:in `block in create'
  app/controllers/messages_controller.rb:35:in `create'

我的sidekiq日志显示它应该没问题?

2015-12-10T16:49:39.220Z 10448 TID-ows27pimw INFO: Booting Sidekiq 3.5.3 with redis options {:url=>"redis://localhost:6379/0",:password=>"REDACTED",:namespace=>"sidekiq"}
2015-12-10T16:49:40.916Z 10448 TID-ows27pimw INFO: Running in ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]

这是我在初始化器中的sidekiq.rb

Sidekiq.configure_server do |config|
  config.redis = { :url => "redis://#{}localhost:6379/0",password: ENV["REdis_PASSWORD"],:namespace => "sidekiq" }
end

解决方法

您需要在服务器和客户端块中配置Redis,如 Using Redis wiki page中所述.

相关文章

validates:conclusion,:presence=>true,:inclusion=>{...
一、redis集群搭建redis3.0以前,提供了Sentinel工具来监控各...
分享一下我老师大神的人工智能教程。零基础!通俗易懂!风趣...
上一篇博文 ruby传参之引用类型 里边定义了一个方法名 mo...
一编程与编程语言 什么是编程语言? 能够被计算机所识别的表...
Ruby类和对象Ruby是一种完美的面向对象编程语言。面向对象编...