Why do I get HTTP Response 302 or 301 when installing a gem?

gem install rake 
ERROR: While executing gem ... (Gem::RemoteSourceException) 
    HTTP Response 302

You need to upgrade RubyGems. See:

http://rubygems.org/pages/download