ERROR: While executing gem (Gem::RemoteSourceException) HTTP Response 302 fetching

by Learn PHP on July 10, 2011

While struggling with old gems and ruby installation on my macosx. I googled a lot for response and find no satisfactory answer.

The problem was simple, macosx 10.5 comes with ruby 1.8.1 and rails 1.2.6 which is now a depreciated version of ROR and not recommended to be used for production.

Now since gems have moved there base, every gem install command was throwing a 302 HTTP error.

$ sudo gem install rails
ERROR:  While executing gem ... (Gem::RemoteSourceException)
    HTTP Response 302 fetching http://gems.rubyforge.org/yaml

Even the most suggested resolution which is a gem update didn’t work.

gaurav-mishras-macbook:rubygems-1.8.5 gaurav$ sudo gem update --system
Updating RubyGems...
ERROR:  While executing gem ... (Gem::RemoteSourceException)
    HTTP Response 302 fetching http://gems.rubyforge.org/yaml

Then luckily a landed to a blog post which mentioned a similar problem and changing the source of the gem repositry worked like charm. Just add –source http://production.s3.rubygems.org

For example

gaurav-mishras-macbook:rubygems-1.8.5 gaurav$ sudo gem update --system --source http://production.s3.rubygems.org
Updating RubyGems...

{ 5 comments… read them below or Shout @ me! }

Randy July 23, 2011 at 3:51 am

This worked perfectly for me, thank you. Days of irritation = over.

Reply

Learn PHP August 1, 2011 at 1:40 pm

Glad this worked for you Randy. :)

Reply

Kai December 5, 2011 at 6:08 am

gems fixed, headache GONE! Thank you! :)

Reply

Brian Richardson February 3, 2012 at 1:02 am

Yea!! Thanks!

Reply

Reisclef February 12, 2012 at 8:41 am

Thank you so much!

I’ve been searching for hours on how to do this!

“RubyGems 1.3.6 installed”

Reply

Leave a Comment

Previous post:

Next post: