# Is there a way to freeze Rails \_after\_ the fact?

**URL:** <https://www.ruby-forum.com/t/is-there-a-way-to-freeze-rails-after-the-fact/138608>\
**Category:** Deployment\
**Created:** [May 25, 2008, 8:49pm UTC](https://www.ruby-forum.com/t/is-there-a-way-to-freeze-rails-after-the-fact/138608 "2008-05-25T20:49:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [May 25, 2008, 8:49pm UTC](https://www.ruby-forum.com/t/is-there-a-way-to-freeze-rails-after-the-fact/138608/1 "2008-05-25T20:49:54Z")

</div>

I’ve got a managed VPS (the hosting service provides support) and they  
just did an unannounced upgrade to Rails 2.0. My app is 1.2.x. Is  
there a way to freeze Rails and the other gems my app needs to a prior  
version _after_ the fact? I’m really in a bind here.

Thanks,  
Bill

---

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [May 25, 2008, 9:08pm UTC](https://www.ruby-forum.com/t/is-there-a-way-to-freeze-rails-after-the-fact/138608/2 "2008-05-25T21:08:08Z")

</div>

On 25.5.2008, at 21.48, Bill W. wrote:

> I’ve got a managed VPS (the hosting service provides support) and  
> they just did an unannounced upgrade to Rails 2.0. My app is  
> 1.2.x. Is there a way to freeze Rails and the other gems my app  
> needs to a prior version _after_ the fact? I’m really in a bind here.

You should have this line in your config/environment.rb:

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

Just uncomment it and set it to whatever version you want to use. Of  
course, that gem version must still exist on the system but normally  
updating gems doesn’t remove old versions. Note that you should imho  
ALWAYS set RAILS\_GEM\_VERSION unless you have frozen gems (or edge) to  
your app’s vendor directory. Otherwise you will forever be at the  
mercy of your host messing with the gems.

Cheers,  
//jarkko

> -~----------~----~----~----~------~----~------~–~—

–  
Jarkko L.

> **[jlaine.net](https://jlaine.net/)**
>
> Your freedom to carry a gun messes with my freedom to walk around without fear. Your freedom to “stand your ground” with force is at odds with my …

> **[Home](https://dotherightthing.com/)**
>
> do the right thing

[http://www.railsecommerce.com](http://www.railsecommerce.com)  
[http://odesign.fi](http://odesign.fi)

---

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [May 26, 2008, 5:19am UTC](https://www.ruby-forum.com/t/is-there-a-way-to-freeze-rails-after-the-fact/138608/3 "2008-05-26T05:19:16Z")

</div>

On 25 mai, 14:48, “Bill W.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’ve got a managed VPS (the hosting service provides support) and they just did an unannounced upgrade to Rails 2.0. My app is 1.2.x. Is there a way to freeze Rails and the other gems my app needs to a prior version _after_ the fact? I’m really in a bind here.

Yup! Sure do 🙂

$ sudo gem install piston  
$ piston import  
[http://dev.rubyonrails.org/svn/rails/branches/1-2-stable/](http://dev.rubyonrails.org/svn/rails/branches/1-2-stable/)  
vendor/rails

Or use the old trick of svn export (which is essentially what Piston  
does). Since you’re on 1.2, you won’t need Piston 1.9+ (will be 2.0  
at some point) which can import from Git repositories.

More info on Piston at [http://piston.rubyforge.org/](http://piston.rubyforge.org/)

Bye !  
François Beausoleil

---

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [May 26, 2008, 2:36pm UTC](https://www.ruby-forum.com/t/is-there-a-way-to-freeze-rails-after-the-fact/138608/4 "2008-05-26T14:36:28Z")

</div>

Thanks, Francois. I appreciate the help!

Best regards,  
Bill

francois.beausoleil wrote:
