title: RVM switching Rails Versions
body: <p>The situation is that my default gemset on my computer points to <code>rails 5.0.0</code>.  However: I have an app that uses a really old rails version. Lets say for this example the app uses: <code>rails 2.1.1</code>.  </p>
  
  <p>Does my machine automatically switch to <code>rails 2.1.1</code> when <code>cd'ed</code> into this app because <code>rails 2.1.1</code> is specified in the <code>Gemfile</code>?  Or: do I need to <strong><em>explicitly</em></strong> create a gemset in order for my app and my machine to do things the "rails 2.1.1 way" (as opposed to doing stuff the "rails 5.0.0 way which is the rails version in my default gemset)?  </p>
  
  <p>My concern is that perhaps if my machine thinks I am using <code>rails 5.0.0</code> instead of <code>rails 2.1.1</code> while developing inside the app: then rails commands such as generators might create files and do stuff "the rails 5.0.0 way" as opposed to the "rails 2.1.1" way.</p>
  
  <p>Hopefully this makes sense.  Here is what I would do in order to "explicitly" state via a Gemset that this app uses <code>rails 2.1.1</code></p>
  
  <p><strong>Example:</strong></p>
  
  <p>I create a gemset that is to be specified for any app that uses <code>rails 2.1.1</code></p>
  
  <pre><code>rvm gemset create rails_2_1_1
  </code></pre>
  
  <p>I specify the ruby version to use on this gemset</p>
  
  <pre><code>rvm use 2.2.1@rails_2_1_1
  </code></pre>
  
  <p>I then install that old version of rails onto this gemset:</p>
  
  <pre><code>gem install rails --version=2.1.1
  </code></pre>
  
  <p>Now this gemset uses <code>rails 2.1.1</code>.</p>
  
  <p>Now at the root of my app I specify a <code>.ruby-gemset</code> file that tells rails: "Make sure you are doing stuff the <code>rails 2.1.1</code> way and not the <code>rails 5.0.0</code> way:</p>
  
  <pre><code>#.ruby-gemset
  rails_2_1_1
  </code></pre>
  
  <p>I want to be sure that if another rails version is specified in an app's Gemfile than is in my default gemset: then developing within that app will do everything within the context of the rails version specified in the Gemfile as opposed to the rails version in the default gemset. </p>