# What happens when Rails 1.3.5 is installed on top of 2.3.5?

**URL:** <https://www.ruby-forum.com/t/what-happens-when-rails-1-3-5-is-installed-on-top-of-2-3-5/188982>\
**Category:** Rails\
**Created:** [May 21, 2010, 11:44am UTC](https://www.ruby-forum.com/t/what-happens-when-rails-1-3-5-is-installed-on-top-of-2-3-5/188982 "2010-05-21T11:44:10Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![winterheat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7993a0/32.png) [@winterheat](https://www.ruby-forum.com/u/winterheat)\
**Post date:** [May 21, 2010, 11:44am UTC](https://www.ruby-forum.com/t/what-happens-when-rails-1-3-5-is-installed-on-top-of-2-3-5/188982/1 "2010-05-21T11:44:10Z")

</div>

On a Mac running Snow Leopard, the Rails version was 2.3.5 (by using  
rails -v)

and then I used gem install to install about 20 things, and maybe there  
was a line on the instructions that was there in the past that says

gem install rails -v=1.3.5

and I ran it anyways, thinking that maybe 1.3.5 is a different version  
number…

and it installed 5 gems (as i remember).

Will that actually affect the current rails?

Even after the installation, when I use

rails -v

it still says 2.3.5

and also if it is

gem list rails

it would list something like

rails (2.3.5, 2.3.2, 1.3.5)

so looks like they exist nicely with each other without affecting one  
another? thanks.

---

<div class="post-metadata">

**Author:** ![winterheat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7993a0/32.png) [@winterheat](https://www.ruby-forum.com/u/winterheat)\
**Post date:** [May 21, 2010, 11:59am UTC](https://www.ruby-forum.com/t/what-happens-when-rails-1-3-5-is-installed-on-top-of-2-3-5/188982/2 "2010-05-21T11:59:12Z")

</div>

On May 21, 10:44 am, Jian L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> and also if it is
> 
> gem list rails
> 
> it would list something like
> 
> rails (2.3.5, 2.3.2, 1.3.5)
> 
> so looks like they exist nicely with each other without affecting one  
> another? thanks.

Yup, rubygems is designed to handle that sort of thing. Installed  
executables (eg the rails executable that sets up a new app) will run  
the latest version), you can run older versions by doing (for example)  
rails _1.3.5_ anoldapp  
The fiddly stuff is when the old version of rails doesn’t cope with  
the version of ruby you have, eg rails didn’t handle ruby 1.8.7 before  
2.1 (I think, could be a different version but you get the idea) or  
uses functionality that was deprecated and later removed in newer  
versions of rubygems.

Fred

---

<div class="post-metadata">

**Author:** ![winterheat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7993a0/32.png) [@winterheat](https://www.ruby-forum.com/u/winterheat)\
**Post date:** [May 22, 2010, 8:48pm UTC](https://www.ruby-forum.com/t/what-happens-when-rails-1-3-5-is-installed-on-top-of-2-3-5/188982/3 "2010-05-22T20:48:59Z")

</div>

Just in case it applies here is an extract from the Pickaxe book  
(Second edition, page 217):

“Threre’s a subtlety when it comes to installing different versions of  
the same application with RubyGems. Even though RubyGems keeps  
separate versions of the application’s library files, it does not  
version the actual command you use to run the application. As a  
result, each install of an application effectively overwrites the  
previous one.”

---

<div class="post-metadata">

**Author:** ![winterheat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7993a0/32.png) [@winterheat](https://www.ruby-forum.com/u/winterheat)\
**Post date:** [May 23, 2010, 4:48am UTC](https://www.ruby-forum.com/t/what-happens-when-rails-1-3-5-is-installed-on-top-of-2-3-5/188982/4 "2010-05-23T04:48:54Z")

</div>

pepe wrote:

> Just in case it applies here is an extract from the Pickaxe book  
> (Second edition, page 217):
> 
> “Threre’s a subtlety when it comes to installing different versions of  
> the same application with RubyGems. Even though RubyGems keeps  
> separate versions of the application’s library files, it does not  
> version the actual command you use to run the application. As a  
> result, each install of an application effectively overwrites the  
> previous one.”

so that means it will be safest if i re-run

gem install rails

or

gem install rails -v2.3.5

again?

---

<div class="post-metadata">

**Author:** ![winterheat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7993a0/32.png) [@winterheat](https://www.ruby-forum.com/u/winterheat)\
**Post date:** [May 23, 2010, 3:02pm UTC](https://www.ruby-forum.com/t/what-happens-when-rails-1-3-5-is-installed-on-top-of-2-3-5/188982/5 "2010-05-23T15:02:46Z")

</div>

I would, just in case, not being sure of the repercussions that  
installing a prior version of the gem would have.

---

<div class="post-metadata">

**Author:** ![winterheat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7993a0/32.png) [@winterheat](https://www.ruby-forum.com/u/winterheat)\
**Post date:** [May 23, 2010, 4:44pm UTC](https://www.ruby-forum.com/t/what-happens-when-rails-1-3-5-is-installed-on-top-of-2-3-5/188982/6 "2010-05-23T16:44:01Z")

</div>

On Sat, May 22, 2010 at 2:47 PM, pepe [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Just in case it applies here is an extract from the Pickaxe book  
> (Second edition, page 217):
> 
> “Threre’s a subtlety when it comes to installing different versions of  
> the same application with RubyGems. Even though RubyGems keeps  
> separate versions of the application’s library files, it does not  
> version the actual command you use to run the application. As a  
> result, each install of an application effectively overwrites the  
> previous one.”

That’s actually not the whole story, and excerpt from the output of  
gem help install:

Description:  
The install command installs local or remote gem into a gem  
repository.

```
For gems with executables ruby installs a wrapper file into the 

```

executable  
directory by default. This can be overridden with the --no-wrappers  
option.  
The wrapper allows you to choose among alternate gem versions using  
_version_.

```
For example `rake _0.7.3_ --version` will run rake version 0.7.3 if 

```

a newer  
version is also installed.

The “actual command you use to run the application” is actually a bit  
of boilerplate generated by gems which requires the gem and then calls  
the executable in the bin directory of the gem. If you use that  
_{version}_ option it requires a specific version of the gem.

So if you have both rails 2.3.5 and 1.2.6 installed then either

rails  
or  
rails _2.3.5_

will run version 2.3.5 which is the latest version installed. but

rails _1.2.6_

will run version 1.2.6

HTH

BTW, the OP gave rails version 1.3.5 as a example, as far as I know  
this a fictitious version since rails went from version 1.2.6 to  
version 2.0.0

–  
Rick DeNatale

Blog: [http://talklikeaduck.denhaven2.com/](http://talklikeaduck.denhaven2.com/)  
Github: [rubyredrick (Rick DeNatale) · GitHub](http://github.com/rubyredrick)  
Twitter: @RickDeNatale  
WWR: [http://www.workingwithrails.com/person/9021-rick-denatale](http://www.workingwithrails.com/person/9021-rick-denatale)  
LinkedIn: [http://www.linkedin.com/in/rickdenatale](http://www.linkedin.com/in/rickdenatale)

---

<div class="post-metadata">

**Author:** ![winterheat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7993a0/32.png) [@winterheat](https://www.ruby-forum.com/u/winterheat)\
**Post date:** [May 23, 2010, 4:59pm UTC](https://www.ruby-forum.com/t/what-happens-when-rails-1-3-5-is-installed-on-top-of-2-3-5/188982/7 "2010-05-23T16:59:53Z")

</div>

Rick Denatale wrote:

> That’s actually not the whole story, and excerpt from the output of  
> gem help install:
> 
> Description:  
> The install command installs local or remote gem into a gem  
> repository.
> 
> ```
> For gems with executables ruby installs a wrapper file into the 
> 
> ```
> 
> executable  
> directory by default. This can be overridden with the --no-wrappers  
> option.  
> The wrapper allows you to choose among alternate gem versions using  
> _version_.
> 
> ```
> For example `rake _0.7.3_ --version` will run rake version 0.7.3 if 
> 
> ```
> 
> a newer  
> version is also installed.

What about if Rails 2.3.5 is installed and then 1.2.5 is installed? It  
seems like after that

rails -v

will still give 2.3.5. So the default executable is not overwritten or  
linked to 1.2.5 but to the newest version.

Also, if we run

rails _1.2.5_

the won’t all the supporting files, script, etc, etc also need to be  
versioned? So probably that is automatically taken care of as well?

So, supposedly, we can install rails in ANY ORDER – 2.3.5 first, and  
then 2.2.2 and then 1.2.5 and they still all work well, and the default  
one is still the 2.3.5 version?

wow, if only Windows application can do that too…
