title: Is it possible to create a new rails app with a rails version that we haven't installed yet?
body: <p>searching for an answer to the question above in Stackoverflow I have always bumped into a similar - but not equal - question: whether it is possible to create a new rails app with an older version than the latest installed on the computer (one of the most popular posts of this kind is <a href="https://stackoverflow.com/questions/379141/specifying-rails-version-to-use-when-creating-a-new-application">Specifying rails version to use when creating a new application</a>). However, <strong>what I'm interested in is knowing if it's possible to run a command such as 'rails __2.1.0__ new myapp' even if that specific rails version is not yet installed on my computer</strong> so that when it runs it it automatically installs this rails version plus it creates all the starting files (in which the Gemfile contains all the compatible gems of that specific version already).</p>
  
  <p>As an example...
  Right now I'm following the Rails Tutorial book by Michael Hartl and we are asked to use the ruby version 2.0.0, the rails version 4.0.8 and to include the following info into the Gemfile:</p>
  
  <pre><code>source 'https://rubygems.org'
  ruby '2.0.0'
  #ruby-gemset=railstutorial_rails_4_0
  
  gem 'rails', '4.0.8'
  
  group :development do
    gem 'sqlite3', '1.3.8'
  end
  
  gem 'sass-rails', '4.0.1'
  gem 'uglifier', '2.1.1'
  gem 'coffee-rails', '4.0.1'
  gem 'jquery-rails', '3.0.4'
  gem 'turbolinks', '1.1.1'
  gem 'jbuilder', '1.0.2'
  
  group :doc do
    gem 'sdoc', '0.3.20', require: false
  end
  </code></pre>
  
  <p>It happens that I have by default ruby-2.1.2 and rails 4.1.4 so when I have wanted to follow Hartl's book I have had to <strong>create a new rails application</strong> (which sets up the Gemfile according to rails 4.1.4) and after that I have had to <strong>cd into the new app</strong>, run <strong>$ gem install rails --version 4.0.8</strong> to install the version, <strong>substitute the default Gemfile that came with rails 4.1.4 for the above code</strong>, then <strong>run bundle install and bundle update</strong>.</p>
  
  <p>It seems to work, but all in all it is a <em>rather tedious and annoying solution</em>. Couldn't this be solved, like I wrote at the beggining, with a 'rails ____2.1.0____ new myapp' in which version 2.1.0 (that I do not have installed) gets installed at that moment?</p>
  
  <p>I'm sure there has to be an easier way to get started with a different rails version project, I just don't find it or try to solve it with the wrong commands. I'm sure the solution I implemented wasn't good enough either since whenever I try to create another rails app using a version that I have allegedly already installed (2.0.0) this is what I get from the Terminal:</p>
  
  <pre><code>Desktop$ rails _2.0.0_ new myapp
  /Users/gaa/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/dependency.rb:313:in `to_specs': Could not find 'railties' (= 2.0.0) - did find: [railties-4.1.4,railties-4.1.1] (Gem::LoadError)
  Checked in 'GEM_PATH=/Users/gaa/.rvm/gems/ruby-2.1.2:/Users/gaa/.rvm/gems/ruby-2.1.2@global', execute `gem env` for more information
  from /Users/gaa/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/dependency.rb:322:in     `to_spec'
  from /Users/gaa/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_gem.rb:53:in `gem'
  from /Users/gaa/.rvm/gems/ruby-2.1.2/bin/rails:22:in `&lt;main&gt;'
  from /Users/gaa/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `eval'
  from /Users/gaa/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `&lt;main&gt;'
  </code></pre>
  
  <p>I would really appreciate a helping hand.</p>