[英]Redis::CannotConnectError (Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED)):
On my heroku I get error 在我的Heroku上我报错
Redis::CannotConnectError (Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED)):
2016-04-14T09:25:04.155091+00:00 app[web.1]: app/controllers/users /registrations_controller.rb:123:in `send_confirmation_email'
2016-04-14T09:25:04.155092+00:00 app[web.1]: app/controllers/users/registrations_controller.rb:49:in `daycare'
I also add addon Redis to go
我还添加了插件Redis to go
Your application should not try to connect to the localhost. 您的应用程序不应尝试连接到本地主机。 Instead, your initializer should fetch the env var ( REDIS_URL
IIRC) and use it if it exists. 相反,您的初始化程序应获取env var( REDIS_URL
IIRC)并使用它(如果存在)。
Make sure you have Redis installed. 确保已安装Redis。 I know you said you got this on Heroku, but for example, if you were on a Mac and were using Homebrew, you could simply run brew install redis
, and you'd be good to go. 我知道您说过您是在Heroku上获得的,但是例如,如果您使用Mac并使用Homebrew,则只需运行brew install redis
,就可以了。 (It fixed it for me, anyway.) (无论如何,它为我解决了问题。)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.