We built an api in rails and are hosting it on heroku and using apn_sender to do the push notifications. We got everything running locally with apn_sender but when we push it to heroku and run
heroku rake apn:sender
we get the following error “Connection refused – Unable to connect to Redis on 127.0.0.1:6379”
We added the redistogo addon.
UPDATE
We added a resque.rb initializer:
require 'resque'
uri = URI.parse(ENV["REDISTOGO_URL"])
Resque.redis = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password)
and called to start up the worker
heroku rake environment apn:sender
and everything seemed to work.
Ok, so after further testing, the update I put in above doesn’t work for very long before it crashes. We then followed this http://blog.redistogo.com/2010/07/26/resque-with-redis-to-go/
Changing
to
and
to
and it worked like a charm. Also note, that we had to add a worker dyno in heroku, which costs .05/hour or $35/month.