HTTP Response 302 fetching

Hi, I am moving to mac os x 10.5.6 and wanted to update rails from
Rails 1.2.6 to something higher, so I typed in my terminal sudo gem
update --system it just doesn't seem to work. Always when I try to
update in terminal it gives me out this error : ERROR: While
executing gem ... (Gem::RemoteSourceException)
    HTTP Response 302 fetching http://gems.rubyforge.org/yaml
Anyone can help me?