# Possible to run rails 1.2.x and 2.0.x on the same host?

**URL:** <https://www.ruby-forum.com/t/possible-to-run-rails-1-2-x-and-2-0-x-on-the-same-host/145784>\
**Category:** Deployment\
**Created:** [August 13, 2008, 10:12pm UTC](https://www.ruby-forum.com/t/possible-to-run-rails-1-2-x-and-2-0-x-on-the-same-host/145784 "2008-08-13T22:12:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 13, 2008, 10:12pm UTC](https://www.ruby-forum.com/t/possible-to-run-rails-1-2-x-and-2-0-x-on-the-same-host/145784/1 "2008-08-13T22:12:25Z")

</div>

Hello,

Does anyone have experience running multiple versions of rails on a  
single host? Is this even a reasonable suggestion?

Thanks.

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 13, 2008, 10:14pm UTC](https://www.ruby-forum.com/t/possible-to-run-rails-1-2-x-and-2-0-x-on-the-same-host/145784/2 "2008-08-13T22:14:11Z")

</div>

I run multiple Rails version on my server, by specifying the version  
my app requires in the environment.rb file, I have no issues. The  
alternative (which I usually do) is to freeze the Rails version that  
your app uses to the vendor folder.

Hope that helps.

– Jamie van Dyke  
– Parfait

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 14, 2008, 6:13pm UTC](https://www.ruby-forum.com/t/possible-to-run-rails-1-2-x-and-2-0-x-on-the-same-host/145784/3 "2008-08-14T18:13:17Z")

</div>

Are there any good references of what the freeze process is used for,  
and why?

I found the Deployment book to fall a little short on freezing.

I’ve tried freezing, and it appears to have deleted everything in the  
path, when I do an svn update, I get it all back.

Also, the architecture of deployment with respect to ruby (and also  
rails) independtly.

I’m a little confused on where the framework lives, is the Rails  
version I use part of my deployment, or is that provided by the ISP on  
their server?

I’m pretty sure I’m stuck with whatever ruby version they install,  
unless I install my own.

On Thu, Aug 14, 2008 at 4:23 AM, Aníbal Rojas [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> –
> 
> > Thanks.

–  
Anthony E.  
408-656-2473  
[http://anthony.ettinger.name](http://anthony.ettinger.name)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 15, 2008, 3:51pm UTC](https://www.ruby-forum.com/t/possible-to-run-rails-1-2-x-and-2-0-x-on-the-same-host/145784/4 "2008-08-15T15:51:00Z")

</div>

Anthony,

On Aug 15, 11:12 am, “Anthony E.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Are there any good references of what the freeze process is used for, and why?

$ rake -D rails:freeze:edge  
(in /home/anibal/sandboxes/cb-claimchaser-trunk)  
rake rails:freeze:edge  
Lock to latest Edge Rails, for a specific release use  
RELEASE=1.2.0

$ rake -D rails:freeze:gems  
(in /home/anibal/sandboxes/cb-claimchaser-trunk)  
rake rails:freeze:gems  
Lock this application to the current gems (by unpacking them into  
vendor/rails)

If you have have in your development box different rails applications  
tied to different rails versions you will need to freeze so each  
application uses the freezed rails version under vendor/rails folder.

If you don’t have control on what rails gems are installed you should  
not take chances and freeze rails before ever thinking on deploying.

> I found the Deployment book to fall a little short on freezing.
> 
> I’ve tried freezing, and it appears to have deleted everything in the  
> path, when I do an svn update, I get it all back.

Please add more info here.

> Also, the architecture of deployment with respect to ruby (and also  
> rails) independtly.

These are two different things,it would be unusual having trouble with  
your Ruby version.

> I’m a little confused on where the framework lives, is the Rails  
> version I use part of my deployment, or is that provided by the ISP on  
> their server?

When a Rails based applications initializes it can use a a specific  
Rails version available as a gem, or use the same libraries located  
under vendor/rails

> I’m pretty sure I’m stuck with whatever ruby version they install,  
> unless I install my own.

if you are not running your own VPS or Dedicated Server, I would not  
recommend trying to install your own Ruby version, it requires  
building from source, fixing paths for the build and setting up  
environment variables, it is possible, but it is a lot of work if you  
don’t have the skills.

Good luck,

–  
Aníbal Rojas

> **[Home - Has Many Developers](https://hasmanydevelopers.com/)**
>
> We are the best choice for your building design and development

> **[RUBYCORNER.COM](https://www.rubycorner.com/)**
>
> RUBYCORNER.COM - Contact us for any business inquiries

[http://anibal.rojas.com.ve](http://anibal.rojas.com.ve)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [November 6, 2008, 5:48pm UTC](https://www.ruby-forum.com/t/possible-to-run-rails-1-2-x-and-2-0-x-on-the-same-host/145784/5 "2008-11-06T17:48:21Z")

</div>

Freezing isn’t the best way, there’s a much simpler method.

1. Define the version of Rails your app requires in config/  
environment.rb. For example, one of the apps I’ve worked on this week  
has  
RAILS\_GEM\_VERSION = ‘2.1.2’ unless defined? RAILS\_GEM\_VERSION

2. For each app you’re running on the server, install that version’s  
gem to the system like normal. For the above app, I’d do a  
sudo gem install rails --version=‘2.1.2’

The app then selects the correct gem when it is started. You can have  
as many different versions of Rails installed to the system gem path  
as you like:

ben@zaphod ~ $ ls -1d $GEMS/rails\*  
/opt/local/lib/ruby/gems/1.8/gems/rails-1.2.5  
/opt/local/lib/ruby/gems/1.8/gems/rails-2.0.2  
/opt/local/lib/ruby/gems/1.8/gems/rails-2.1.0  
/opt/local/lib/ruby/gems/1.8/gems/rails-2.1.1  
/opt/local/lib/ruby/gems/1.8/gems/rails-2.1.2  
/opt/local/lib/ruby/gems/1.8/gems/rails-2.2.0  
ben@zaphod ~ $

I’m not sure whether rake gems:install handles this step; if it does,  
then things are even simpler.

1. Done.

Ben Hoskings

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 14, 2008, 1:23pm UTC](https://www.ruby-forum.com/t/possible-to-run-rails-1-2-x-and-2-0-x-on-the-same-host/145784/6 "2008-08-14T13:23:30Z")

</div>

Ed,

```
Follow Jamie's advice, not only it is possible and reasonable, but

```

Rails is designed to support this feature. Buy the Obie’s Rails Way  
and check the first chapter where he explains how a Rails application  
is initialized, later continue with rest of the book 😉

```
Bests regards,

```

–  
Aníbal Rojas

> **[Home - Has Many Developers](https://hasmanydevelopers.com/)**
>
> We are the best choice for your building design and development

> **[RUBYCORNER.COM](https://www.rubycorner.com/)**
>
> RUBYCORNER.COM - Contact us for any business inquiries

[http://anibal.rojas.com.ve](http://anibal.rojas.com.ve)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [November 7, 2008, 3:31am UTC](https://www.ruby-forum.com/t/possible-to-run-rails-1-2-x-and-2-0-x-on-the-same-host/145784/7 "2008-11-07T03:31:01Z")

</div>

I’m using GIT to keep all Rails versions and I’m exporting the needed  
one in proj/vendor/rails:

[http://tt.zhekov.net/post/51803697/switching-between-several-rails-versions](http://tt.zhekov.net/post/51803697/switching-between-several-rails-versions)
