title: How to fix the uninitialized constant Rake::DSL problem on Heroku?
body: <p>I am getting errors similar to the ones <a href="https://stackoverflow.com/questions/6091964/delayed-job-queue-not-being-processed-on-heroku">in</a> <a href="https://stackoverflow.com/questions/6085610/rails-rake-problems-uninitialized-constant-rakedsl">these</a> <a href="https://stackoverflow.com/questions/5287121/undefined-method-task-using-rake-0-9-0/5290331#5290331">questions</a>, except mine are occuring on <a href="http://www.heroku.com" rel="nofollow noreferrer">Heroku</a>:</p>
  
  <pre><code>2011-05-30T09:03:29+00:00 heroku[worker.1]: Starting process with command: `rake jobs:work`
  2011-05-30T09:03:30+00:00 app[worker.1]: (in /app)
  2011-05-30T09:03:30+00:00 heroku[worker.1]: State changed from starting to up
  2011-05-30T09:03:33+00:00 app[worker.1]: rake aborted!
  2011-05-30T09:03:33+00:00 app[worker.1]: uninitialized constant Rake::DSL
  2011-05-30T09:03:33+00:00 app[worker.1]: /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.0/lib/rake/tasklib.rb:8:in `&lt;class:TaskLib&gt;'
  </code></pre>
  
  <p>The answer in those questions seems to be to specify <code>gem 'rake', '0.8.7'</code> because the 0.9 version causes the problem.</p>
  
  <p>When I try to add <code>gem 'rake', '0.8.7'</code> to my gemfile and push to Heroku I get this error:</p>
  
  <pre><code>Unresolved dependencies detected; Installing...
  You have modified your Gemfile in development but did not check
  the resulting snapshot (Gemfile.lock) into version control
  
  You have added to the Gemfile:
  * rake (= 0.8.7)
  FAILED: http://devcenter.heroku.com/articles/bundler
  ! Heroku push rejected, failed to install gems via Bundler
  error: hooks/pre-receive exited with error code 1
  To git@heroku.com:my_app.git
  ! [remote rejected] master -&gt; master (pre-receive hook declined)
  error: failed to push some refs to 'git@heroku.com:my_app.git'
  </code></pre>
  
  <p>My gemfile normally works fine on Heroku. What should I do?</p>