[英]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,如使用Redis wiki頁面中所述 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.