# Setting rails version

**URL:** <https://www.ruby-forum.com/t/setting-rails-version/123402>\
**Category:** Rails\
**Created:** [December 17, 2007, 12:39pm UTC](https://www.ruby-forum.com/t/setting-rails-version/123402 "2007-12-17T12:39:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dzonekl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/8c91f0/32.png) [@dzonekl](https://www.ruby-forum.com/u/dzonekl)\
**Post date:** [December 17, 2007, 12:39pm UTC](https://www.ruby-forum.com/t/setting-rails-version/123402/1 "2007-12-17T12:39:34Z")

</div>

Hello,

How do I tell rails to use a specified version when creating the  
application directory structure?  
I have multiple versions of rails installed through gem, but I can’t  
find how to choose?

Any ideas?

thanks!  
Christophe Bouhier

---

<div class="post-metadata">

**Author:** ![dzonekl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/8c91f0/32.png) [@dzonekl](https://www.ruby-forum.com/u/dzonekl)\
**Post date:** [December 17, 2007, 12:52pm UTC](https://www.ruby-forum.com/t/setting-rails-version/123402/2 "2007-12-17T12:52:38Z")

</div>

In your environment.rb file you should have something like the  
following:

#Specifies gem version of Rails to use when vendor/rails is not present  
RAILS\_GEM\_VERSION = ‘2.0.1’ unless defined? RAILS\_GEM\_VERSION

JB

---

<div class="post-metadata">

**Author:** ![dzonekl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/8c91f0/32.png) [@dzonekl](https://www.ruby-forum.com/u/dzonekl)\
**Post date:** [December 18, 2007, 4:32pm UTC](https://www.ruby-forum.com/t/setting-rails-version/123402/3 "2007-12-18T16:32:44Z")

</div>

On 12/17/07, John B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> In your environment.rb file you should have something like the  
> following:
> 
> #Specifies gem version of Rails to use when vendor/rails is not present  
> RAILS\_GEM\_VERSION = ‘2.0.1’ unless defined? RAILS\_GEM\_VERSION

I interpret the OPs question as how do I generate a particular version  
of rails directory structure.

If that’s the question the answer is to put the gem version  
specification bracketed by underscores as the first argument of the  
rails command

rails _1.2.6_ rails126app

I think you can also do things like

rails _\<2.0_

To get the latest version \< 2.0

–  
Rick DeNatale

My blog on Ruby  
[http://talklikeaduck.denhaven2.com/](http://talklikeaduck.denhaven2.com/)
