title: How to run a specific version of rake
body: <p>Background:</p>
  
  <ul>
  <li>I get errors whenever I run rake in an older project. (uninitialized constant Rake::DSL).</li>
  <li>The rails project in question is an old project that was started with Rails 2.1 (I think), and since then I've updated the OS on my laptop a couple of times, and made updates along the way to make it run.</li>
  <li>Right now, the rails app works fine, provided I have RAILS_GEM_VERSION set to 2.3.5. I'm not sure if the app was <em>completely</em> updated to Rails 2.3.5.</li>
  <li>There is no Gemfile in my older project.</li>
  <li>If I create a brand-new rails project (and unset RAILS_GEM_VERSION), rake runs fine.</li>
  </ul>
  
  <p>My question: To troubleshoot, I'd like to try newer versions of rake. I'd like to know how to force one specific version to be used, since it appears I have multiple versions installed.</p>
  
  <p>Info on my environment:</p>
  
  <pre><code>$ gem list rake
  
  *** LOCAL GEMS ***
  
  rake (0.9.2.2, 0.9.2, 0.8.7, 0.8.3)
  
  
  $ rake --version
  rake, version 0.8.7
  </code></pre>
  
  <p>So it looks like it's picking up the 0.8.7 version.</p>
  
  <p>All the help files online seem to tell me to specify the rake version in the Gemfile, but there isn't one in this project. (Maybe it predates gemfiles?)</p>
  
  <p>If I unset the RAILS_GEM_ENVIRONMENT variable altogether, and try to run rake, I get:</p>
  
  <pre><code>rake aborted!
  can't activate rails (= 2.3.5, runtime) for [], already activated rails-3.2.8 for []
  </code></pre>
  
  <p>None of the environment config files in my older project set that variable either.</p>