# Trouble Freezing Rails

**URL:** <https://www.ruby-forum.com/t/trouble-freezing-rails/178447>\
**Category:** Rails\
**Created:** [November 4, 2009, 8:12pm UTC](https://www.ruby-forum.com/t/trouble-freezing-rails/178447 "2009-11-04T20:12:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ea666f/32.png) [@bob](https://www.ruby-forum.com/u/bob)\
**Post date:** [November 4, 2009, 8:12pm UTC](https://www.ruby-forum.com/t/trouble-freezing-rails/178447/1 "2009-11-04T20:12:54Z")

</div>

I have a Rails app that is currently running in production on Rails  
v1.2.2. Since I didn’t have control of the server that runs the  
production copy of this app, I have put off upgrading to v2.x.  
However, I recently read about freezing Rails to your app, making it  
independent of the version of Rails installed on the server so I  
upgraded my app to v2.3.4. On my development machine everything  
worked great after freezing Rails to my upgraded app, (presumably  
because I have Rails v2.3.4 installed locally). As a test of the  
freezing process, I copied my frozen app to an old PC that only has  
Rails v2.0.2 installed and tried starting up a Mongrel server . This  
is unsuccessful, and causes the following error…

E:/Ruby/lib/ruby/site\_ruby/1.8/rubygem.rb:246: in ‘activate’: can’t  
activate actionpack (= 2.0.2), already activated actionpack-2.3.4]  
(Gem::Exception)

If I go to the gems directory on this box and rename the  
actionpack-2.0.2 directory (such as adding a -) and try starting  
mongrel again I get a similar error message…

E:/Ruby/lib/ruby/site\_ruby/1.8/rubygem.rb:246: in ‘activate’: can’t  
activate rails (= 2.0.2), already activated rails-2.3.4]  
(Gem::Exception)

I checked my controllers for includes that might be causing this, but  
nothing seemed suspicious (only includes were for ‘date’, ‘net/http’,  
and ‘uri’) Any help with this would be greatly appreciated. Freezing  
seemed so straightforward, don’t know why it’s causing me so many  
problems.

Thanks for any nuggets of insight / wisdom that come my way…

---

<div class="post-metadata">

**Author:** ![bob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ea666f/32.png) [@bob](https://www.ruby-forum.com/u/bob)\
**Post date:** [November 5, 2009, 5:56pm UTC](https://www.ruby-forum.com/t/trouble-freezing-rails/178447/2 "2009-11-05T17:56:24Z")

</div>

If you post the rest of the backtrace, it will be much more helpful.  
The activation is coming from _somewhere_, so the trace will show  
that.

–Matt J.

---

<div class="post-metadata">

**Author:** ![bob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ea666f/32.png) [@bob](https://www.ruby-forum.com/u/bob)\
**Post date:** [November 6, 2009, 4:44pm UTC](https://www.ruby-forum.com/t/trouble-freezing-rails/178447/3 "2009-11-06T16:44:59Z")

</div>

Thanks for the reply Matt,

Unfortunately, I cannot post more of the backtrace because I am unable  
to reproduce the same error now that I have made progress on this  
problem. I did the following on the machine with Rails 2.0.2 on it  
and all works well there now.

-updated rubygems from 0.9.4 to 1.3.5 and updated all gems that  
rubygems-update-1.3.5 depends on (builder, session, hoe-seattlerb,  
minitest, hoe)  
-installed rack gem 1.0.1

My next hurdle is to attempt freezing all of these gems and forcing  
rubygems-update to be loaded on my production app. I was thinking of  
doing this by adding a ‘require’ into dispatch.fcgi but I’m not sure  
if this is wise or if it’ll even work at all.

Of course I welcome any advice anyone has…

---

<div class="post-metadata">

**Author:** ![bob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ea666f/32.png) [@bob](https://www.ruby-forum.com/u/bob)\
**Post date:** [November 6, 2009, 11:11pm UTC](https://www.ruby-forum.com/t/trouble-freezing-rails/178447/4 "2009-11-06T23:11:23Z")

</div>

If you don’t control the server and the Rubygems version is old,  
you’re pretty much out of luck. The only way around it is to compile a  
new Ruby and Rubygems from source and tell your app to use that.  
You’ll probably want to check with whoever _does_ control the server  
about the availability of the compiler toolchain before trying that  
(on Site5, they needed to add you to a special “compiler” group, for  
instance).

–Matt J.
