4

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

4
  • Are you behind a proxy? Commented Apr 26, 2016 at 15:25
  • What happens when you try to go to rubygems.org in your browser? Commented Apr 26, 2016 at 15:26
  • @Uzbekjon I can't say. But yes it's something like that. I'm unable to install anything I'm going to attempt to allow it through the port and see what happens. Commented Apr 26, 2016 at 15:28
  • @user12341234 It opens, no lag, no nothing. It's not my connection. Commented Apr 26, 2016 at 15:29

3 Answers 3

6

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]
Sign up to request clarification or add additional context in comments.

6 Comments

This would probably work and all, except I'm not the network admin, so I don't have access to the proxy information
Try to check the proxy settings in your browser. if it is not set to automatic, just copy paste the values to your .gemrc file.
You do actually. What OS are you on? Google, how to see network and proxy settings. You are probably on DHCP network. Basically, when you physically connect to the server, your network settings are "sent/set" from the "central" server.
Well I've discovered that it's a type of script. Not a proxy, it's what they use for secure internet
I do have an idea, if I can connect to my phone wifi, I might be able to pull this off as a work around.
|
4

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

Comments

-1

Try to install them in non -proxy environment, It worked for me.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.