title: Can't connect to redis on heroku
body: <p>I'm using sidekiq with active_job in my rails application. The job currently works but I am unable to get connect to the Redis when deploying to heroku. In heroku I have the RedisToGo addon. When pushing to heroku I get the following error. </p>
  
  <h3>error</h3>
  
  <pre><code>/app/vendor/bundle/ruby/2.2.0/gems/redis-3.2.1/lib/redis/client.rb:331:in `rescue in establish_connection': Error connecting to Redis on 127.0.0.1:6379 (Errno::ECONNREFUSED) (Redis::CannotConnectError)
  </code></pre>
  
  <h3>config/application.rb</h3>
  
  <pre><code>config.after_initialize do
    PasswordAgingJob.perform_later
    SetOffCallJob.perform_later
  end
  </code></pre>
  
  <h3>config/initializers/redis.rb</h3>
  
  <pre><code>uri = URI.parse(ENV["REDISTOGO_URL"] || "redis://localhost:6379/" )
  REDIS = Redis.new(:host =&gt; uri.host, :port =&gt; uri.port, :password =&gt; uri.password)
  </code></pre>
  
  <h3>config/initializers/active_job.rb</h3>
  
  <pre><code>ActiveJob::Base.queue_adapter = :sidekiq
  </code></pre>