Reputation: 1674
Whilst installing Ruby gems I'm getting the following error:
ERROR: Could not find a valid gem 'bundler' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - Errno::ETIMEDOUT:
Failed to open TCP connection to api.rubygems.org:443 (A connection attempt fai
led because the connected party did not properly respond after a period of time,
or established connection failed because connected host has failed to respond.
- connect(2) for "api.rubygems.org" port 443) (https://api.rubygems.org/specs.4.
8.gz)
Gems I've attempted to install:
Nokogiri
Mechanize
Bundler
(Obviously)All producing the same error, I'm guessing it's all the gems, not just bundler.
I've never seen this before so I'm not sure what to do, could someone tell me what's going on? It's probably worth mentioning that I am on a secure network.
UPDATE:
I've attempted to initialize a new rule in my firewall that will allow me to use TCP connection through port 443 (the port that gem install
runs off of); However I'm still getting the error
UPDATE:
I've done some research and attempted to update using gem update --system
via this resource. However it's still throwing the same error, and will not allow me to update
Upvotes: 3
Views: 14196
Reputation: 79
Try to install them in non -proxy environment, It worked for me.
Upvotes: -1
Reputation: 1674
I'm not entirely sure what happened. However I was able to get onto another network and download gems.
There was no proxy, there was no VPN setup, but there was a default script so I'm guessing that had something to do with it.
So the resolution was I got onto a different network and successfully installed what I needed
Upvotes: 3
Reputation: 11823
I had the same problem recently and it was a proxy issue.
If you are on corporate network (work, university, dorm, etc.) probably you are too. Identify your proxy server information (see network settings) and try to add proxy info to your gem install
command.
Depending on your gem version, one of these should work:
gem install --http-proxy http://[user]:[password]@[server]:[port]
gem install -p http://[user]:[password]@[server]:[port]
If that's your main net access, then you can set it to be used by default. Create .gemrc
file in your home dir (user folder in windows or linux) and set the proxy settings there:
http_proxy: http://[user]:[password]@[server]:[port]
Upvotes: 6