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
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... 22.214.171.124
- Connecting to rubyforge.org|126.96.36.199|: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... 188.8.131.52
- Connecting to files.rubyforge.vm.bytemark.co.uk|184.108.40.206|: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
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:
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
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.