Take the 2-minute tour ×

Question 828421 asked similar question, but received only one real answer (update rubygems) and that attempt results in the same error.

Ruby version 1.9.1.p243 on Windows. Included Gem, version 1.3.5. Never installed any gems before; never did any special config for this Ruby. Ruby itself works, as does irb, and "gem" operates but can't do install (and maybe other ops).

Tried this (from a book):

gem install rspec

Got this:

ERROR: http://gems.rubyforge.org/ does not appear to be a repository
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError) SocketError: getaddrinfo: The storage control blocks were destroyed. (http://gems.rubyforge.org/yaml)

When I go to that URL (without "yaml") using MSIE7, I get a page titled "Gemcutter | awesome gem hosting" and have no problem wandering around that site. So I don't -think- it's a proxy problem (though this is all from inside corporate firewall/proxies/etc).

When I go to that URL -with- "yaml", it goes to "http://production.s3.rubygems.org/yaml" and shows what I assume is an update specification page, starting with this: --- !ruby/object:Gem::SourceIndex

I didn't destroy any "storage control blocks". So what is preventing gem from installing a gem?

Web search shows MANY people having this same problem over a long span of time, but I have yet to see anyone say "It's because of THIS, so do THIS to fix it." Well, someone suggested updating "gem", but trying that gets same error.

Help please?

share|improve this question

5 Answers 5

up vote 14 down vote accepted

Your browser might be using system-wide proxy settings or some sort of automatic configuration. The gem command probably doesn't. I'm behind an university proxy and I can't install/update any gems normally, but can access everything with my browser. To install gems, I normally create a tunnel to my server so I can bypass the proxy server.

This might help you to configure the proxy settings for the gem command: http://stackoverflow.com/questions/4418/how-do-i-update-ruby-gems-from-behind-a-proxy-isa-ntlm

share|improve this answer
Yes, my browser uses automatic configuration. Is there some way to tell "gem" to use a proxy? Ah, I see you've added a link for me. Thanks! :) –  mike Feb 10 '10 at 16:21
As written in one of the answers to the linked question, you could try gem install --http-proxy http://localhost:3128 _name_of_gem_ –  Tomas Markauskas Feb 10 '10 at 16:23
Just replace localhost:3128 with the actual proxy server address and port. –  Tomas Markauskas Feb 10 '10 at 16:24
Thanks! That works great! –  mike Feb 10 '10 at 16:30


sudo gem install nifty-generators -p http://proxy:port

It works well.

share|improve this answer

If your proxy requires authentication, then use:

gem install --http-proxy http://USERNAME:PASS@HOST:PORT gem_name
share|improve this answer

This can "at times" mean that for some reason rubygems.org is down currently, and so your local "invisible proxy" is returning you a 404 or what not.

share|improve this answer

@Tomas Markauskas didn't work for me because i'm not behind a proxy. And I didn't find a solution anywhere, I tried disable my AV and firewall, didn't

This was the solution for me:

gem install rails -r -w -p

Hope this will help people with the same problem.

EDIT: I have Windows 7 64bit.

share|improve this answer

Your Answer


