Pergunta

I have followed the following tutorial: https://devcenter.heroku.com/articles/queuing-ruby-resque and it doesn't state anything about AUTH with Redis.

When I try to open the resque-web to manage the workers, I get an Internal Error, also when trying this, inside the Heroku rails console:

irb(main):001:0> Resque.queues

I get this:

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

So, I am wondering what should I do to make this work correctly. DO I need to set up any kind of auth? If so, where? I am using Redis Cloud addon.

Thanks

Foi útil?

Solução

It looks like you're not initializing resque. To do so, you need something like the following:

# config/initiazlizers/resque.rb
uri = URI.parse ENV["REDISCLOUD_URL"]
Resque.redis = Redis.new host:uri.host, port:uri.port, password:uri.password

This initializer reads your URL from the Heroku environment variable that was set by the rediscould add-on, parses it, and passes it to Resque so it connects and authenticates with the redis server.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top