# Upgrading Ruby

**URL:** <https://www.ruby-forum.com/t/upgrading-ruby/141255>\
**Category:** Ruby\
**Created:** [June 24, 2008, 3:08am UTC](https://www.ruby-forum.com/t/upgrading-ruby/141255 "2008-06-24T03:08:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![caliwildman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a6a055/32.png) [@caliwildman](https://www.ruby-forum.com/u/caliwildman)\
**Post date:** [June 24, 2008, 3:08am UTC](https://www.ruby-forum.com/t/upgrading-ruby/141255/1 "2008-06-24T03:08:46Z")

</div>

I currently have Ruby 1.8.5 and Rails 1.2.3. I want to upgrade Ruby to  
1.8.6 and Rails to 2.1. I have a Windows XP development machine and FC6  
production box. I can’t find a clean up to upgrade Ruby without blowing  
away the installed gems. Someone suggested this workaround:  
There’s no ruby update AFAIK. You can work around this by renaming  
c:\ruby to something else, installing ruby, then overwrite  
C:\ruby\lib\ruby\gems with the old version and call ‘gem update’ to  
fetch the new versions.

I am in the middle of trying that now but I stopped with the following  
concerns:

1. current gems include Rails like actionmailer, actionpack,  
actionrecord, etc. plus a number of other gems I installed. If I run gem  
update, won’t this update Rails to 2.1 automatically?
2. I also have mongrel gems installed and remembered something having to  
install Windows specific packages (can’t recall off the top of my now  
the details), so I am worried that this wouldn’t be handled properly.
3. I also installed htree but I can’t tell if it is a gem, so I can’t be  
sure that it will be handled properly.

I am sure I am not the only guy that is trying to upgrade Ruby, can  
anyone help me? Thanks in advance.

---

<div class="post-metadata">

**Author:** ![caliwildman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a6a055/32.png) [@caliwildman](https://www.ruby-forum.com/u/caliwildman)\
**Post date:** [June 25, 2008, 12:48am UTC](https://www.ruby-forum.com/t/upgrading-ruby/141255/2 "2008-06-25T00:48:44Z")

</div>

On Tue, Jun 24, 2008 at 03:06, Cali W.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I currently have Ruby 1.8.5 and Rails 1.2.3. I want to upgrade Ruby to  
> 1.8.6 and Rails to 2.1. I have a Windows XP development machine and FC6  
> production box. I can’t find a clean up to upgrade Ruby without blowing  
> away the installed gems. Someone suggested this workaround:

I’m that someone 😉

> There’s no ruby update AFAIK. You can work around this by renaming  
> c:\ruby to something else, installing ruby, then overwrite  
> C:\ruby\lib\ruby\gems with the old version and call ‘gem update’ to  
> fetch the new versions.
> 
> I am in the middle of trying that now but I stopped with the following  
> concerns:
> 
> 1. current gems include Rails like actionmailer, actionpack,  
> actionrecord, etc. plus a number of other gems I installed. If I run gem  
> update, won’t this update Rails to 2.1 automatically?

you can freeze your rails prior to ruby reinstall

> **[Freezing Rails | Tiger Technologies Support](https://support.tigertech.net/freeze-rails)**
>
> If you are using Ruby on Rails and want to ensure maximum stability, you should "freeze" the version of Rails you use.

> 1. I also have mongrel gems installed and remembered something having to  
> install Windows specific packages (can’t recall off the top of my now  
> the details), so I am worried that this wouldn’t be handled properly.

I’m not sure but I assume gem will ask everytime which version to  
install.

> 1. I also installed htree but I can’t tell if it is a gem, so I can’t be  
> sure that it will be handled properly.

Check either by running gem list or look at c:\ruby\lib\1.8\gems\

> I am sure I am not the only guy that is trying to upgrade Ruby, can  
> anyone help me? Thanks in advance.

What you can do to be safe is to backup/rename your c:\ruby (e.g. to  
c:\ruby-1.8.5).  
Then install new version, copy gems, update them and test your rails  
app.  
In case of problems, you can put c:\ruby-1.8.5 back to c:\ruby

Problem with this approach is that it messes list of installed  
applications (Control Panel, Add/remove apps).  
Maybe better would be backup, uninstall 1.8.5, install 1.8.6, replace  
gems, update, check  
Rollback: uninstall 1.8.6, install 1.8.5, replace the whole dir.

Still, this all is hackish. I guess one of the features the new MSI  
installer could bring is ability to properly update.

J.

---

<div class="post-metadata">

**Author:** ![caliwildman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a6a055/32.png) [@caliwildman](https://www.ruby-forum.com/u/caliwildman)\
**Post date:** [June 25, 2008, 7:03am UTC](https://www.ruby-forum.com/t/upgrading-ruby/141255/3 "2008-06-25T07:03:56Z")

</div>

Jano S. wrote:

> What you can do to be safe is to backup/rename your c:\ruby (e.g. to  
> c:\ruby-1.8.5).  
> Then install new version, copy gems, update them and test your rails  
> app.  
> In case of problems, you can put c:\ruby-1.8.5 back to c:\ruby
> 
> Problem with this approach is that it messes list of installed  
> applications (Control Panel, Add/remove apps).  
> Maybe better would be backup, uninstall 1.8.5, install 1.8.6, replace  
> gems, update, check  
> Rollback: uninstall 1.8.6, install 1.8.5, replace the whole dir.
> 
> Still, this all is hackish. I guess one of the features the new MSI  
> installer could bring is ability to properly update.
> 
> J.

Unfortunately due to the fact that htree uses site\_ruby instead of gems,  
it isn’t as simple as I hope per your workaround. Plus there may be new  
gems added in 2.1 that aren’t in 1.2.3, so that’s another concern.  
Likewise, 2.1 site\_ruby has some new files and folders that aren’t there  
in 1.2.3 site\_ruby. So it seems pretty messy.
