• Home »
  • Insights »
  • RubyGems ERROR: Error Installing Cucumber, hoe Requires RubyGems version 1.3.1

RubyGems ERROR: Error Installing Cucumber, hoe Requires RubyGems version 1.3.1

While creating a development environment for a Ruby project earlier I ran into an error installing some of the gems required by the project. I realized that I had installed an older version of RubyGems which was causing problems with some of the gem dependents that needed to be installed. Below I list one of the examples of the errors I was running into and how I resolved the issue.

RubyGems Error Installing Cucumber:

[root@cent1 src]# gem install cucumber
Updating metadata for 83 gems from http://gems.example.com
...................................................................................
complete
Updating metadata for 119 gems from http://gems.example.com/
.......................................................................................................................
complete
ERROR:  Error installing cucumber:
        hoe requires RubyGems version >= 1.3.1

As you can see above when I attempted to install cucumber it complained that RubyGems version 1.3.1 or greater was required. I was pointed to a gems server that is specific to this project which actually has rubygems-update version 1.3.5 available however in the past when I have tried to update using “gem update rubygems-update” it appears to succeed however the active RubyGems version is still the older version. So the RubyGems package I initially installed was RubyGems version 1.1.1 because I was following some older notes. To resolve the problem you simply need to download the newer version of RubyGems, unpack it, and install it using the simple steps below.

Upgrade Your RubyGems By Downloading A New RubyGems Version:

  1. Download RubyGems 1.3.5: Issue the below command from your Linux server to download a newer version of RubyGems. Typically it is a good idea to build packages in “/usr/local/src” so “cd” into that directory before issuing the below command.
    wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz
    
  2. Unpack RubyGems 1.3.5: Now issue the below command to uncompress and unpack the RubyGems package you downloaded in step 1.
    tar -zxvf rubygems-1.3.5.tgz
    
  3. Install RubyGems 1.3.5: Now “cd rubygems-1.3.5″ and then issue the below command to install the updated RubyGems version. I included the entire shell output of the command so you would get an idea of what should happen when installing the new RubyGems version.
    [root@cent1 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
    
  4. Verify RubyGems Version: Now verify that RubyGems was upgraded by issuing the below command.
    [root@cent1 rubygems-1.3.5]# gem --version
    1.3.5
    

Now you should be able to install the cucumber gem and the cucumber dependent gems without issue as displayed in the below example output.

Install Cucmber Gem After Updating RubyGems:

[root@cent1 rubygems-1.3.5]# gem --version
1.3.5
[root@cent1 rubygems-1.3.5]# gem install cucumber

(::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)

                     (::)   U P G R A D I N G    (::)

Thank you for installing cucumber-0.6.2.
Please be sure to read http://wiki.github.com/aslakhellesoy/cucumber/upgrading
for important information about this release. Happy cuking!

(::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)

Successfully installed polyglot-0.2.9
Successfully installed treetop-1.4.3
Successfully installed diff-lcs-1.1.2
Successfully installed json_pure-1.2.0
Successfully installed cucumber-0.6.2
5 gems installed
Installing ri documentation for polyglot-0.2.9...
Installing ri documentation for treetop-1.4.3...
Installing ri documentation for diff-lcs-1.1.2...
Installing ri documentation for json_pure-1.2.0...
Installing ri documentation for cucumber-0.6.2...
Installing RDoc documentation for polyglot-0.2.9...
Installing RDoc documentation for treetop-1.4.3...
Installing RDoc documentation for diff-lcs-1.1.2...
Installing RDoc documentation for json_pure-1.2.0...
Installing RDoc documentation for cucumber-0.6.2...

You can use the same method to upgrade RubyGems in the future if necessary.

Ruby: Visual QuickStart Guide (Paperback)

By (author): Larry Ullman


List Price: $34.99 USD
New From: $48.86 USD In Stock
Used from: $4.43 USD In Stock


List Price: $44.99 USD
New From: $9.06 USD In Stock
Used from: $3.51 USD In Stock

Share