仍然无法在Heroku上连接到redis。一切都在当地很好。
我安装了'redis'宝石,并在heroku网站上找到了redistogo_url。我还将生产env变量添加到heroku。
当我尝试运行依赖于redis和sidekiq的载波背景进程时,我不断收到以下错误。
redis.rb
uri = URI.parse(ENV["REDISTOGO_URL"])
REDIS = Redis.new(host: uri.host, port: uri.port, password: uri.password)
在配置文件中
if Rails.env.development?
ENV['REDISTOGO_URL'] = 'redis:://@localhost:6379'
else
ENV["REDISTOGO_URL"] = 'redis://redistogo:my_hash_key@greeneye.redistogo.com:9286/'
end
ERROR
2015-03-21T04:44:47.560613+00:00 heroku[router]: at=info method=POST path="/photos" host=www.luminoto.com request_id=92ad0e79-45c4-413d-8dc6-b3fdfe1754b8 fwd="98.222.43.13" dyno=web.1 connect=1ms service=1396ms status=302 bytes=1609
2015-03-21T04:44:47.560695+00:00 app[web.1]: Error connecting to Redis on 127.0.0.1:6379 (Errno::ECONNREFUSED)
2015-03-21T04:44:47.560721+00:00 app[web.1]: Error connecting to Redis on 127.0.0.1:6379 (Errno::ECONNREFUSED)