I'm trying to install the bundler gem using $ gem install bundler
. When I execute the command, I receive the following response:
ERROR: Could not find a valid gem 'bundler' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - Errno::ETIMEDOUT: Operation timed out - connect(2) (https://api.rubygems.org/latest_specs.4.8.gz)
ERROR: Possible alternatives: bundler
In an effort to make sure I wasn't going crazy, I tried installing nokogiri:
ERROR: Could not find a valid gem 'nokogiri' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - Errno::ETIMEDOUT: Operation timed out - connect(2) (https://api.rubygems.org/latest_specs.4.8.gz)
ERROR: Possible alternatives: nokogiri
And a2z:
ERROR: Could not find a valid gem 'a2z' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - Errno::ETIMEDOUT: Operation timed out - connect(2) (https://api.rubygems.org/quick/Marshal.4.8/a2z-0.1.3.gemspec.rz)
If anyone has experience this issue before and can help me out it would be greatly appreciated.
If it helps, I'm running MacOS Mavericks and have gem version 2.2.2.
Too Late but i resolve this issue disabling the IPv6 connections in my system OS. It forces the OS just use the IPv4 and then it works.
For people using Windows, the following worked for me on Windows 10. See also my reply on the ruby gems issues list.
api.rubygems.org is having issues with IPV6 host address. I faced the same issue after I setup the ubuntu server in vbox. We need to configure it to use our host's IPV4 first and then try IPV6.
So we can change the priority by adding this line ti /etc/gai.conf:
# Debian defaults.
precedence ::1/128 50
precedence ::/0 40
precedence 2002::/16 30
precedence ::/96 20
precedence ::ffff:0:0/96 10
# Low precedence for api.rubygems.org IPv6 addresses.
precedence 2a04:4e42::0/32 5
And it worked like a charm!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With