on 24 Apr, 2018 02:40 PM
*This is on a fully updated Debian 8 server. I have other servers with the same OS at the same host without this issue. I used ruby-build to install ruby 2.3.7 and ruby 2.4.4, and I can't find a single error in any system log (including the firewall). I'd be ecstatic if anyone has any idea of where to look or what to check. All rubies on this server suddenly started having the same issue as OP a couple weeks ago.
I'm experiencing the same problem, running NixOS and I've tried ruby 2.4.1 and 2.5.0. It seems to affect every gem I've tried so far (ffi, coderay, rouge, spoon). I've tried https and http. I'm able to curl a specific gem (e.g. `curl http://rubygems.org/gems/ffi-1.9.23.gem -o outfile`) successfully.
I just tried the same nmap commands and IPv6 looks fine now as well. I'm also now able to fetch dependencies successfully. It's not quite definitive evidence, but does lend support to the theory that IPv6 was the issue. Thanks for pointing that out, Alexei!
on 10 May, 2018 08:16 PM
The same problem is currently being experienced by me.
Rubygems is unable to download from https://api.rubygems.org/specs.4.8.gz, yet that address is reachable by me (via ping) and I can download the file using my browser without problem.
I only just now updated to the latest rubygems (2.7.6, using Ruby 2.4.4p296) (had issues before and after update).
Thanks for pointing out that our ipv6 isn't work. We will try to fix it as soon as possible. It shouldn't cause your gem install to fail or timeout tho. rubygems client uses ipv4 addresses. Can you please verify you see ipv6 requests are being made when you run gem install ?
on 22 May, 2018 12:44 PM
Here is gem's debug output, if it will be helpful:
$ time gem search --remote --verbose --debug rails
NOTE: Debugging mode prints all exceptions even when rescued
Exception `LoadError' at /usr/lib/ruby/2.5.0/resolv.rb:170 - LoadError
*** REMOTE GEMS ***
Exception `Errno::EEXIST' at /usr/lib/ruby/2.5.0/fileutils.rb:232 - File exists @ dir_s_mkdir - /home/alexei/.gem/specs/api.rubygems.org%443
Exception `Errno::ENOENT' at /usr/lib/ruby/2.5.0/rubygems/remote_fetcher.rb:325 - No such file or directory @ rb_file_s_stat - /home/alexei/.gem/specs/api.rubygems.org%443/latest_specs.4.8
Exception `Net::OpenTimeout' at /usr/lib/ruby/2.5.0/net/http.rb:937 - execution expired
Exception `Net::OpenTimeout' at /usr/lib/ruby/2.5.0/net/http.rb:939 - execution expired
Exception `Net::OpenTimeout' at /usr/lib/ruby/2.5.0/timeout.rb:114 - execution expired
Exception `Net::OpenTimeout' at /usr/lib/ruby/2.5.0/net/http.rb:997 - execution expired
Exception `Gem::RemoteFetcher::UnknownHostError' at /usr/lib/ruby/2.5.0/rubygems/remote_fetcher.rb:306 - timed out (https://api.rubygems.org/latest_specs.4.8.gz)
Exception `Gem::RemoteFetcher::UnknownHostError' at /usr/lib/ruby/2.5.0/rubygems/spec_fetcher.rb:269 - timed out (https://api.rubygems.org/latest_specs.4.8.gz)