title: using apn_sender on heroku
body: <p>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</p>
  
  <pre><code>heroku rake apn:sender
  </code></pre>
  
  <p>we get the following error "Connection refused - Unable to connect to Redis on 127.0.0.1:6379"</p>
  
  <p>We added the redistogo addon.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>We added a resque.rb initializer:</p>
  
  <pre><code>require 'resque'
  
  uri = URI.parse(ENV["REDISTOGO_URL"])
  Resque.redis = Redis.new(:host =&gt; uri.host, :port =&gt; uri.port, :password =&gt; uri.password)
  </code></pre>
  
  <p>and called to start up the worker</p>
  
  <pre><code>heroku rake environment apn:sender
  </code></pre>
  
  <p>and everything seemed to work.</p>