Fixing the Rails requires RubyGems >= 1.3.1 Error
By divas on Dec 08, 2008
Many of you who are trying out the NetBeans IDE Ruby support are running into the following error message:
Rails requires RubyGems >= 1.3.1 (you have 1.2.0). Please `gem update --system` and try again.
This is not a NetBeans error message. It is generated by the Rails framework. This error message happens if you upgrade to Rails 2.2.2.
To compound the frustration, it seems that the suggested command gem update --system does not work on all versions of Ruby Gems. When you try the command, you get a message that there is nothing to update. Fortunately, there is a work around.
Here is one way to fix this Rails/Ruby Gems version mismatch. If you have more than one Ruby installation (for example, you have the JRuby that is installed with the IDE and you have a separate MRI Ruby installation), you need to run the command for each installation. Note that the path to the bundled JRuby bin directory is <netbeans-install-dir>/ruby2/jruby-1.1.4/bin.
In the following steps, replace ruby with jruby if you are updating your JRuby installation.
Open a terminal window and change (cd) to the JRuby or Ruby bin directory.
Type ruby -S gem --version
If the version is 1.3.1, then that installation has already been updated and you are done. Otherwise, continue.
Type ruby -S gem install rubygems-update
Type ruby -S update_rubygems
To ensure that the update happened, type ruby -S gem --version