今天想更新RubyGems,突然发现 gem update ––system 貌似不work了: [cc lang=”bash”] $ gem -v 1.5.0 [/cc] [cc lang=”bash”] $ gem update –system Updating RubyGems ERROR: While executing gem … (NoMethodError) undefined method `version’ for nil:NilClass [/cc] turns out 这是 RubyGems 1.5.0 和 1.5.1 的一个bug,1.5.2 fix了这个issue。 Manual的Upgrade可以绕过 reinstall 的麻烦和繁琐,且更低碳环保: [cc lang=”bash”] $ gem install rubygems-update Fetching: rubygems-update-1.5.2.gem (100%) Successfully installed rubygems-update-1.5.2 1 gem installed [/cc] [cc lang=”bash” nowrap=”false” lines=”-1”] $ update_rubygems RubyGems 1.5.2 installed === 1.5.2 / 2011-02-10 NOTE: RubyGems 1.5.0 and 1.5.1 have a broken gem update –system. To upgrade you’ll need to use the manual upgrade recipe. Using sudo/su as appropriate: $ gem install rubygems-update $ update_rubygems Bug Fixes: * Fixed gem update –system. RubyGems can now update itself again. ————————————————————————— RubyGems installed the following executables: /Users/samson/.rvm/rubies/ruby-1.9.2-p136/bin/gem [/cc]