title: sidekiq does not generate sidekiq.pid file on heroku, using with Redistogo
body: <p>I've been struggling for two days with getting sidekiq work on heroku production environment. I've read all the available documentation about similar issues, and still haven't been able to produce a working solution, I'd really like some help!</p>
  
  <p>After deploying on heroku, my app crashes and I get the following error stack trace:</p>
  
  <pre><code>2014-09-23T23:38:40.905093+00:00 app[worker.1]: No such file or directory @ rb_sysopen - /app/tmp/pids/sidekiq.pid
  2014-09-23T23:38:40.905122+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.1.0/bin/sidekiq:23:in `&lt;main&gt;'
  2014-09-23T23:38:40.905119+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.1.0/gems/sidekiq-3.2.5/bin/sidekiq:7:in `&lt;top (required)&gt;'
  2014-09-23T23:38:40.905117+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.1.0/gems/sidekiq-3.2.5/lib/sidekiq/cli.rb:347:in `write_pid'
  2014-09-23T23:38:40.905115+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.1.0/gems/sidekiq-3.2.5/lib/sidekiq/cli.rb:347:in `open'
  2014-09-23T23:38:40.905121+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.1.0/bin/sidekiq:23:in `load'
  2014-09-23T23:38:40.905118+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.1.0/gems/sidekiq-3.2.5/lib/sidekiq/cli.rb:41:in `parse'
  2014-09-23T23:38:40.905114+00:00 app[worker.1]: /app/vendor/bundle/ruby/2.1.0/gems/sidekiq-3.2.5/lib/sidekiq/cli.rb:347:in `initialize'
  2014-09-23T23:38:39.588001+00:00 heroku[worker.1]: State changed from starting to up
  </code></pre>
  
  <p>First, sidekiq is working correctly on my local machine. I'm using heroku's REDISTOGO for redis, on local production, sidekiq have been pointed to the REDISTOGO correctly and running fine.</p>
  
  <p>Second, according to the stack trace, especially this line <code>No such file or directory @ rb_sysopen - /app/tmp/pids/sidekiq.pid</code>; it leads me to think that for some reason <code>sidekiq.pid</code> file is not generated correctly when running on heroku. On local environment, the <code>sidekiq.pid</code> file is generated everytime I start the app in the <code>app/tmp/pids/</code> directory, and assigns a different <code>pid</code> number every time. I'm <code>guessing</code> that when running on heroku, <code>sidekiq</code> tried to read from this file yet could not find it.</p>
  
  <p>Here is contents in my <code>Procfile</code>:</p>
  
  <pre><code>web: bundle exec rails server
  worker: bundle exec sidekiq -C config/sidekiq.yml
  </code></pre>
  
  <p>Here is contents in my <code>config/sidekiq.yml</code></p>
  
  <pre><code>---
  :verbose: true
  :pidfile: ./tmp/pids/sidekiq.pid
  :concurrency: 25
  # Set timeout to 8 on Heroku, longer if you manage your own systems.
  :timeout: 8
  :queues:
    - carrierwave
  </code></pre>
  
  <p>Here is contents in my <code>sidekiq.rb</code></p>
  
  <pre><code>Sidekiq.configure_server do |config|
    config.redis = { :url =&gt; ENV['REDISTOGO_URL'], :namespace =&gt; "mynamespece"}
  end
  
  Sidekiq.configure_client do |config|
      config.redis = { :url =&gt; ENV['REDISTOGO_URL'], :namespace =&gt; "mynamespece"}
  end
  </code></pre>
  
  <p>Update <code>1</code>:</p>
  
  <p>I'm using <code>carrierwave</code> and <code>carrierwave-backgrounder</code> in sync with <code>sidekiq</code>.</p>