Heroku RedisCloud Redis :: CannotConnectError on localhost而不是REDISCLOUD_URL

abc*_*e13 5 ruby ruby-on-rails heroku redis

有很多像这样的问题,但似乎都没有解决我的问题.这是grub:

Rails 4,使用Resque和Redis的Ruby 2.0.0应用程序.

我的redis初始化程序:

#config/initializers/redis.rb
if ENV["REDISCLOUD_URL"]
    $redis = Redis.new(:url => ENV["REDISCLOUD_URL"])
end
Run Code Online (Sandbox Code Playgroud)

这是错误,由heroku日志报告:

Redis::CannotConnectError: Error connecting to Redis on 127.0.0.1:6379 (ECONNREFUSED)
Run Code Online (Sandbox Code Playgroud)

我的procfile:

web: bundle exec rackup config.ru -p $PORT
resque: env TERM_CHILD=1 QUEUES=* bundle exec rake resque:work
Run Code Online (Sandbox Code Playgroud)

如果有帮助,我的意思REDISCLOUD_URL是:

redis://rediscloud:somestuff@someotherstuff:17695
Run Code Online (Sandbox Code Playgroud)

它不在http://.这是一个问题吗?

我已经在这个问题上尝试过所有其他堆栈溢出帖子,但没有任何作用.有小费吗?我一直关注RedisCloud Heroku页面:https://devcenter.heroku.com/articles/rediscloud

abc*_*e13 5

没关系,我找到了答案.我$redis = Resque.redis = Redis.new ...在我的redis.rb初始化程序中做了,然后我不得不迁移我的数据库.傻我.