5

There are quite a few questions like this, but none seem to resolve my issue. Here's the grub:

Rails 4, Ruby 2.0.0 app using Resque and Redis.

My redis initializer:

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

Error is this, as reported by heroku logs:

Redis::CannotConnectError: Error connecting to Redis on 127.0.0.1:6379 (ECONNREFUSED)

My procfile:

web: bundle exec rackup config.ru -p $PORT
resque: env TERM_CHILD=1 QUEUES=* bundle exec rake resque:work

If it helps, my REDISCLOUD_URL is:

redis://rediscloud:somestuff@someotherstuff:17695

It isn't in http://. Is that an issue?

I've tried all the other stack overflow posts on this issues, and nothing works. Any tips? I've been follwing the RedisCloud Heroku page here: https://devcenter.heroku.com/articles/rediscloud

1 Answer 1

6

Nevermind, I found the answer. I did $redis = Resque.redis = Redis.new ... in my redis.rb initializer, and then I had to migrate my db. Silly me.

Sign up to request clarification or add additional context in comments.

2 Comments

Yeah, worked for me too. There seems to be an error in the documentation at heroku. I'll write them
Ah.. You write what you have done, but is actually the right answer?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.