Chronicling My Ruby on Rails Journey

Upgrading Rails 2.1 to 2.3.2

Posted by: Bob Ngu on: May 22, 2009

Right before upgrading Rails 2.1 to 2.3.2, I downloaded a trial version of E text editor (the power of Textmate on Windows), and in the process, it upgraded my cygwin installation.

This caused a couple of errors during my Rails upgrade.

  1. When I ran “gem install rails -y”, I got the error “ruby no such file to load ubygems loaderror”. The problem is caused by E text editor installation and the trick is to go to My Computer properties and unset RUBYOPT variable. It’s set to –rubygems, delete the variable.
  2. With that error gone, there is a new error
    c:/ruby/bin/gem:8:in `require’: no such file to load — rubygems (LoadError) from c:/ruby/bin/gem:8

    Error was also caused by E text editor installation which upgraded cygwin and installed its own version of Ruby. Since cygwin was in environment path before c:\ruby, the gem command picked up the wrong copy of ruby (cygwin has its own Ruby exe). Moving the environment cygwin variable to after c:\ruby fixed the problem.

With those 2 errors fixed, I successfully upgraded Rails to 2.3.2. Next it’s time to upgrade the gems, “gem update –system” generated this error

ERROR: While executing gem … (NameError) undefined local variable or method `remote_gemspecs’ for #

Instead, run these 2 commands to fix it

  1. gem install rubygems-update
  2. update_rubygems

As usual, there are leftover gems, so do the cleanup, run with –d (dryrun) option “gem cleanup -d” first to see what the cleanup would do, then run the cleanup “gem cleanup”. This completes the gem upgrade to 1.3.2.

Leave a Reply