Gemのアップデート

Debian環境でgemを最新版にアップデートしようとすると、

$ sudo gem install -update
ERROR: While executing gem ... (OptionParser::InvalidArgument)
invalid argument: -pdate
$ sudo gem update --system
ERROR: While executing gem ... (RuntimeError)
gem update --system is disabled on Debian, because it will overwrite the con
tent of the rubygems Debian package, and might break your Debian system in subtle ways. The Debian-supported way to update rubygems is through apt-get, using Debian official repositories.
If you really know what you are doing, you can still update rubygems by setting the REALLY_GEM_UPDATE_SYSTEM environment variable, but please remember that this is completely unsupported by Debian.

という感じに怒られてしまいますので、その際の対処法をメモしておきたいと思います。

環境

アップデート

今回も参考にさせていただいたサイトそのままなのでログだけですが
問題なくアップデート出来ると思います。

$ gem -v
1.3.7
$ sudo gem install rubygems-update
Successfully installed rubygems-update-1.8.24
1 gem installed
Installing ri documentation for rubygems-update-1.8.24...
Installing RDoc documentation for rubygems-update-1.8.24...
$ sudo rubygems_update
sudo: rubygems_update: command not found
$ gem environment|grep EXECTAVBLE
$ gem environment|grep EXECUTABLE
- RUBY EXECUTABLE: /usr/bin/ruby1.8
- EXECUTABLE DIRECTORY: /var/lib/gems/1.8/bin
$ sudo /var/lib/gems/1.8/bin/update_rubygems
RubyGems 1.8.24 installed

== 1.8.24 / 2012-04-27

* 1 bug fix:

* Install the .pem files properly. Fixes #320
* Remove OpenSSL dependency from the http code path

                                                                                                                                                          • -

RubyGems installed the following executables:
/usr/bin/gem1.8

$ gem -v
1.8.24