Manually Updating RubyGems
I just did a deployment of my blog and came across a nasty little problem. The deployment in question required that a database migration be run in order to create a new table. Unfortunately, when I tried to run the rake db:migrate command it complained that I was missing a gem. So I tried to install the gem using the command: sudo gem install [gem name].
Here is where the problem comes in. Since I was running RubyGems version 1.0.1, trying to install or update any gem (including updating itself!) would hammer my poor little web server. I think I waited at least 5-10 minutes before killing the process.
This happens because there is a bug in earlier versions of RubyGems. Updating to a newer version (at least 1.2.0) will take care of the issue. Unfortunately, since downloading the RubyGems update will kill the server using the gem update command, I had to install it manually.
First thing is first; download the gem manually using WGET (at the time of this writing the latest RubyGems is at 1.3.1.
wget http://rubyforge.org/frs/download.php/45904/rubygems-update-1.3.1.gem
Once it has been downloaded, install it:
sudo gem install rubygems-update-1.3.1.gem
Finally, update RubyGems:
sudo update_rubygems
If everything went OK, you should see 1.3.1 when running the command gem -v.
Once RubyGems was updated, downloading a single gem was almost instantaneous.
0 comments