Chronicling My Ruby on Rails Journey

May 22, 2009

Upgrading Rails 2.1 to 2.3.2

Filed under: Gem,rails,ruby rails — Bob Ngu @ 7:39 am
Tags: ,

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.

Advertisement

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Theme: Rubric. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.