clbailey/Sinatra-Redis-Heroku-App — Issue #3: Connection refused on Heroku?
Author: WalterYu
Created: 2011-11-28 00:22:29+00:00
State: open

Good work on the template, it deploys correctly onto Heroku. However, the app crashes due to a connection error when it needs to connect to the Redis server on Heroku:

(log output below): Errno::ECONNREFUSED - Connection refused - Unable to connect to Redis on 127.0.0.1:6379:

Here is the configure block that I have inserted into my Sinatra app:

configure do
require 'redis'
uri = URI.parse(ENV["REDISTOGO_URL"])
redisUri = ENV["REDISTOGO_URL"] || 'redis://localhost:6379'
uri = URI.parse(redisUri)
REDIS = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password)
end

Any help would be appreciated.

Thanks,
Walter