Earlier when attempting to install the request-log-analyzer gem on a CentOS Linux server I ran into some issues. I noticed that on one server I was able to install the request-log-analyzer gem without issue but on another server running the same version of CentOS and Ruby as the first server the attempt to install request-log-analyzer returned an error. The error was that the gem required a newer version of another gem.
I started looking further into the issue and noticed that the first server showed only version 1.3.1 of the rubygems-update gem but the second server showed rubygems-update versions 1.3.1, 1.3.0, and 1.1.1 installed.I think checked to see if the “gem” command had the right versions on each server and that is where I located the issue. The server that would not install the request-log-analyzer gem showed version 1.1.1 for the gem command as shown below.
Gem Command Version Output:
- [root@dev bin]# gem --version
- 1.1.1
So I figured that maybe if I cleaned up the previous installs of rubygems-update that it would resolve the issue. I cleaned up the previous versions by issuing the “gem cleanup” command which did remove the previous versions of the rubygems-update gem however the gem command still output version 1.1.1. I tried all sorts of other methods such as updating rubygems-update to version 1.2.0, verifying the permissions of the gem application file, and a bunch of other stuff but none of it worked. Finally I decided to update from the rubygems source which did resolve the problem. Below are the steps taken to update rubygems-update using the package from rubyforge.
Obtain & Install The New Rubygems Package From RubyForge:
First download the new rubygems package, which in this case was version 1.3.5, from www.rubyforge.com. Below is an example of downloading the source using wget to the /usr/local/src directory.
Download Rubygems Version 1.3.5:
- [root@dev src]# wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz
- --11:16:17-- http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz
- Resolving rubyforge.org... 205.234.109.19
- Connecting to rubyforge.org|205.234.109.19|:80... connected.
- HTTP request sent, awaiting response... 302 Found
- Location: http://files.rubyforge.vm.bytemark.co.uk/rubygems/rubygems-1.3.5.tgz [following]
- --11:16:17-- http://files.rubyforge.vm.bytemark.co.uk/rubygems/rubygems-1.3.5.tgz
- Resolving files.rubyforge.vm.bytemark.co.uk... 80.68.94.54
- Connecting to files.rubyforge.vm.bytemark.co.uk|80.68.94.54|:80... connected.
- HTTP request sent, awaiting response... 200 OK
- Length: 278469 (272K) [application/x-tar]
- Saving to: `rubygems-1.3.5.tgz'
- 100%[===========================================================================================>] 278,469 362K/s in 0.8s
- 11:16:19 (362 KB/s) - `rubygems-1.3.5.tgz' saved [278469/278469]
Unpack Rubygems Source Using Tar:
- [root@dev src]# tar -zxvf rubygems-1.3.5.tgz
- rubygems-1.3.5/
- rubygems-1.3.5/.autotest
- rubygems-1.3.5/.document
- rubygems-1.3.5/bin/
- rubygems-1.3.5/bin/gem
- rubygems-1.3.5/bin/update_rubygems
- rubygems-1.3.5/ChangeLog
- ............
- rubygems-1.3.5/test/test_gem_version_option.rb
- rubygems-1.3.5/test/test_kernel.rb
- rubygems-1.3.5/util/
- rubygems-1.3.5/util/CL2notes
- rubygems-1.3.5/util/gem_prelude.rb.template
I will spare you the entire output from unpacking the source. I think there are a little over 200 files and directories that are unpacked from the tar package. Now use “cd” to change the directory into the new rubygems-1.3.5 directory and then ls to list the contents of the directory to make sure all of the necessary items are there such as setup.rb. Next install the new rubygems package as displayed below.
Install New Rubygems Package Using Ruby:
- [root@dev rubygems-1.3.5]# ruby setup.rb
- RubyGems 1.3.5 installed
- === 1.3.5 / 2009-07-21
- Bug fixes:
- * Fix use of prerelease gems.
- * Gem.bin_path no longer escapes path with spaces. Bug #25935 and #26458.
- Deprecation Notices:
- * Bulk index update is no longer supported (the code currently remains, but not
- the tests)
- * Gem::manage_gems was removed in 1.3.3.
- * Time::today was removed in 1.3.3.
- ------------------------------------------------------------------------------
- RubyGems installed the following executables:
- /usr/local/bin/gem
As you can see at the end of the last shell output above the most important part is the installation of the new gem executable in /usr/local/bin. This means that the gem command has been updated and should now show the new version properly as displayed below.
Display Gem Version After Upgrade To Rubygems 1.3.5:
- [root@dev rubygems-1.3.5]# gem --version
- 1.3.5
Thats it! You can now use the new gem command without issue. In my case I was able to install request-log-analyzer without any errors regarding dependencies.
But the big question is, how is request-log-analyzer working for you :)?
Hello Bart,
Umm in short… request-log-analyzer rocks! The default output returned a bunch of crazy output but mized in was the data I needed. Not sure what causes the nutty characters but it most have something to do with my default character encoding. Anyway once I switched to HTML output and had the results mailed to me it looked perfect.
The request-log-analyzer is a very useful tool and I would recommend to anyone for ease of installation and use.
Thanks.
alex
thanks for the steps to upgrade ruby-gems. Tried a number of other sites with no luck but your instructions worked!!
Hello athir,
That is a great compliment. We are always glad to hear when our articles assist people and especially when the articles are easy to follow as well. Ruby is awesome.
Thanks.
alex
Excellent! Thanks!
Hello Zeno,
No problem. Thanks for taking the time to leave feedback.
Thanks.
alex