有很多类似的问题,但似乎都不能解决我的问题。这是我的情况:
使用Resque和Redis的Rails 4、Ruby 2.0.0应用程序。
我的redis初始化程序:
#config/initializers/redis.rb
if ENV["REDISCLOUD_URL"]
$redis = Redis.new(:url => ENV["REDISCLOUD_URL"])
end
错误是这样的,根据heroku日志所述:
Redis::CannotConnectError: Error connecting to Redis on 127.0.0.1:6379 (ECONNREFUSED)
我的Procfile文件:
web: bundle exec rackup config.ru -p $PORT
resque: env TERM_CHILD=1 QUEUES=* bundle exec rake resque:work
如果有帮助的话,我的
REDISCLOUD_URL
是:redis://rediscloud:somestuff@someotherstuff:17695
它不在http://
中。这是一个问题吗?
我已经尝试了所有关于这个问题的Stack Overflow帖子,但都没有起作用。有什么建议吗?我一直在遵循RedisCloud Heroku页面上的说明:https://devcenter.heroku.com/articles/rediscloud