# Work with both rails version 1.2.3 and 2.0

**URL:** <https://www.ruby-forum.com/t/work-with-both-rails-version-1-2-3-and-2-0/140133>\
**Category:** Rails\
**Created:** [June 11, 2008, 6:50am UTC](https://www.ruby-forum.com/t/work-with-both-rails-version-1-2-3-and-2-0/140133 "2008-06-11T06:50:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![purab](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/6de8d8/32.png) [@purab](https://www.ruby-forum.com/u/purab)\
**Post date:** [June 11, 2008, 6:50am UTC](https://www.ruby-forum.com/t/work-with-both-rails-version-1-2-3-and-2-0/140133/1 "2008-06-11T06:50:48Z")

</div>

currently i am working with rails 1.2.3 version. i am using windows xp  
os on my machine. i want to work with rails 1.2.3 and 2.0 both.

but when i install 2.0 on my machine. The older application which is  
created in 1.2.3 version gives me error.  
Is there any way to work on both version without having errors.

---

<div class="post-metadata">

**Author:** ![purab](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/6de8d8/32.png) [@purab](https://www.ruby-forum.com/u/purab)\
**Post date:** [June 11, 2008, 7:42am UTC](https://www.ruby-forum.com/t/work-with-both-rails-version-1-2-3-and-2-0/140133/2 "2008-06-11T07:42:36Z")

</div>

There should be a line at top of your config/environment.rb that  
specifies the rails gem version. You need something like this:

RAILS\_GEM\_VERSION = ‘1.2.3’ unless defined? RAILS\_GEM\_VERSION

Older versions of rails used to generate a line that would use the  
largest rails version present. That’s probably what your 1.2.3 is  
doing.

Aaron

On Jun 10, 10:50 pm, Purab K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![purab](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/6de8d8/32.png) [@purab](https://www.ruby-forum.com/u/purab)\
**Post date:** [June 11, 2008, 9:26am UTC](https://www.ruby-forum.com/t/work-with-both-rails-version-1-2-3-and-2-0/140133/3 "2008-06-11T09:26:33Z")

</div>

You need to freeze the correct rails version into each project. freeze  
is a fancy way of saying “copy the exact version of rails directly  
into my project”. If you do not freeze, the system will grab the most  
current version and use it. When you freeze, rake will create a  
directory named “rails” in your project’s vendor directory and copy  
the appropriate version of rails into that dir and then always use it.  
The command is:  
rake rails:freeze:edge TAG=rel\_1-2-3  
and  
rake rails:freeze:edge TAG=rel\_2-0-2

Good luck

---

<div class="post-metadata">

**Author:** ![purab](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/6de8d8/32.png) [@purab](https://www.ruby-forum.com/u/purab)\
**Post date:** [June 11, 2008, 10:33am UTC](https://www.ruby-forum.com/t/work-with-both-rails-version-1-2-3-and-2-0/140133/4 "2008-06-11T10:33:34Z")

</div>

On Jun 11, 5:50 am, Purab K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> currently i am working with rails 1.2.3 version. i am using windows xp  
> os on my machine. i want to work with rails 1.2.3 and 2.0 both.
> 
> but when i install 2.0 on my machine. The older application which is  
> created in 1.2.3 version gives me error.  
> Is there any way to work on both version without having errors.

First off, do what Aaron says. Then squash any deprecation warnings  
(there are some things that were deprecated in 1.2.x that were removed  
in 2.0) and install any plugins for functionality extracted from core  
(acts\_as\_list, acts\_as\_tree, pagination etc…). If it’s still not  
working then you’ll have to be more specific about what errors.

Fred
