I have multiple versions of the Rails gem installed on my development server. We’ve been using Rails long enough now that we have many apps created for many versions. As I make changes to each app I need to test them in their specific version (the version listed in the environment.rb file) so having multiple Rails versions installed is a necessity.

But if I try to spin up a new application using

  1. $rails new_app
$rails new_app

I get a rails app created specifically for the latest version of Rails installed.

But what if you need to create a new app for an older version of rails that is also installed? The following easy command does the trick:

  1. $rails _1.2.3_ new_app
$rails _1.2.3_ new_app

Where 1.2.3 is the desired version of Rails I want new_app to run. Note the underscores before and after the version.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code lang=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" extra="">