0

I have a Windows Server 2010 VM running via Hyper-V. I can connect to individual gems with a web browser from within the VM, however when I run gem install for any gem, the connection times out with the error I've pasted below. The image is using a virtual switch - do you think this is causing the problem? I'm not sure how to troubleshoot this.

C:\Ruby193\bin>gem install rails -V
Error fetching remote data:             Errno::ETIMEDOUT: A connection attempt f
ailed because the connected party did not properly respond after a period of tim
e, or established connection failed because connected host has failed to respond
. - connect(2) (http://rubygems.org/latest_specs.4.8.gz)
Falling back to local-only install
ERROR:  Could not find a valid gem 'rails' (>= 0) in any repository
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    Errno::ETIMEDOUT: A connection attempt failed because the connected party di
d not properly respond after a period of time, or established connection failed
because connected host has failed to respond. - connect(2) (http://rubygems.org/
latest_specs.4.8.gz)
RobVious
  • 12,685
  • 25
  • 99
  • 181

1 Answers1

3

Perhaps what might be missing is the proxy configuration (considering you can browse to rubygems.org)

You can use --http-proxy option in your gem install command or set HTTP_PROXY environment variable.

First you will need to obtain the proxy configuration, which most likely is in your web browser.

It should look like this:

http://host:port/

Or:

http://username:password@host:port/

You will need need to use it in gem install:

gem install rails --http-proxy=http://host:port/

Or you can avoid typing it everytime if you set it as environment variable:

SET HTTP_PROXY=http://host:port/
gem install rails

You can see more details about this with gem help install documentation.

Hope that helps.

Luis Lavena
  • 10,348
  • 1
  • 37
  • 39
  • Thanks for the response - that's super helpful. Where would I find this information from within a VM? The browser doesn't say anything about proxy settings, as far as I can tell. – RobVious Sep 13 '12 at 14:32
  • @RobVious I'm not sure, never used Windows Server 2010 to tell you the details. I would suggest you check your VM network configuration if is using NAT or bridged mode, that could help figure out these issues. – Luis Lavena Sep 16 '12 at 14:59