Unable to download data from https://rubygems.org/ - timed out

Renan's Avatar

Renan

02 Apr, 2020 04:09 PM

I cannot install gems

renan@ZorinOS:~$ gem install rails
ERROR: Could not find a valid gem 'rails' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - timed out (https://rubygems.org/specs.4.8.gz)

curl -vO https://api.rubygems.org/specs.4.8.gz
  % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
  0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--: 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 2a04:4e42::70...
* TCP_NODELAY set
* Trying 151.101.128.70...
* TCP_NODELAY set
* Connected to api.rubygems.org (151.101.128.70) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
} [5 bytes data]
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
} [512 bytes data]
* TLSv1.3 (IN), TLS handshake, Server hello (2):
{ [112 bytes data]
* TLSv1.2 (IN), TLS handshake, Certificate (11):
{ [4883 bytes data]
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
{ [300 bytes data]
* TLSv1.2 (IN), TLS handshake, Server finished (14):
{ [4 bytes data]
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
} [37 bytes data]
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
} [1 bytes data]
* TLSv1.2 (OUT), TLS handshake, Finished (20):
} [16 bytes data]
* TLSv1.2 (IN), TLS handshake, Finished (20):
{ [16 bytes data]
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use http/1.1
* Server certificate:
* subject: C=US; ST=California; L=San Francisco; O=Fastly, Inc.; CN=l.ssl.fastly.net
* start date: Apr 13 18:39:09 2018 GMT
* expire date: Jun 11 18:15:41 2020 GMT
* subjectAltName: host "api.rubygems.org" matched cert's "*.rubygems.org"
* issuer: C=BE; O=GlobalSign nv-sa; CN=GlobalSign Organization Validation CA - SHA256 - G2
* SSL certificate verify ok.
} [5 bytes data]
> GET /specs.4.8.gz HTTP/1.1
> Host: api.rubygems.org
> User-Agent: curl/7.58.0
> Accept: */*
>
{ [5 bytes data]
< HTTP/1.1 200 OK
< x-amz-id-2: sOzLmypont+eQAEPwYhzAf5t0sDnmw9RNK4xEnl7NQIJx5e+5xYyYPN4MoUkZ1AW7eAcHk3CGmE=
< x-amz-request-id: 8FEAEB1EDDB98CAB
< x-amz-replication-status: COMPLETED
< Last-Modified: Thu, 02 Apr 2020 16:04:06 GMT
< ETag: "c542431ffcb7ca54289b57888f52b6ad"
< Cache-Control: max-age=31536000
< x-amz-meta-surrogate-key: full-index
< x-amz-version-id: eVHZk1.lO.skw4k0QZvu3Ap1Mo30n8dz
< Via: 1.1 varnish
< Content-Type: application/octet-stream
< X-Backend: F_S3 52.218.225.145:443, fastlyshield--shield_ssl_cache_sea4444_SEA 199.27.78.44:443
< Content-Length: 4116249
< Accept-Ranges: bytes
< Date: Thu, 02 Apr 2020 16:05:51 GMT
< Via: 1.1 varnish
< Age: 102
< Connection: keep-alive
< X-Served-By: cache-sea4444-SEA, cache-gru17140-GRU
< X-Cache: HIT, HIT
< X-Cache-Hits: 5, 2
< X-Timer: S1585843552.648759,VS0,VE0
< Vary: Fastly-SSL
< Server: RubyGems.org
<
{ [5 bytes data]
  0 4019k 0 32768 0 0 29335 0 0:02:20 0:00:01 0:02: 7 4019k 7 300k 0 0 146k 0 0:00:27 0:00:02 0:00: 18 4019k 18 748k 0 0 246k 0 0:00:16 0:00:03 0:00: 29 4019k 29 1196k 0 0 295k 0 0:00:13 0:00:04 0:00: 41 4019k 41 1660k 0 0 329k 0 0:00:12 0:00:05 0:00: 55 4019k 55 2220k 0 0 367k 0 0:00:10 0:00:06 0:00: 67 4019k 67 2700k 0 0 384k 0 0:00:10 0:00:07 0:00: 79 4019k 79 3180k 0 0 396k 0 0:00:10 0:00:08 0:00: 91 4019k 91 3660k 0 0 405k 0 0:00:09 0:00:09 --:--:100 4019k 100 4019k 0 0 411k 0 0:00:09 0:00:09 --:--:-- 497k
* Connection #0 to host api.rubygems.org left intact

  1. Support Staff 1 Posted by David Radcliffe on 02 Apr, 2020 04:42 PM

    David Radcliffe's Avatar

    Can you post the output of gem install rails --verbose?

  2. 2 Posted by Matt Thompson on 02 Apr, 2020 09:02 PM

    Matt Thompson's Avatar

    I am having the same issue and here is what I get when trying to install Rails.

    ```
    ERROR: Could not find a valid gem 'rails' (>= 0), here is why:
              Unable to download data from https://rubygems.org/ - timed out (https://rubygems.org/specs.4.8.gz)
    ```

  3. Support Staff 3 Posted by sonalkr132 on 19 Apr, 2020 02:30 PM

    sonalkr132's Avatar

    Please make sure your host doesn't have issue with IPv6 connectivity. You can use this to test you IPv6 configuration: https://test-ipv6.com/

    Also, if you can use curl successfully curl -vO https://api.rubygems.org/specs.4.8.gz but wget https://api.rubygems.org/specs.4.8.gz hangs, it is more likely than not that your host has an IPv6 address but there is some issue with your IPv6 connectivity.

    See: https://bugs.ruby-lang.org/issues/15628

  4. 4 Posted by Vladimir on 03 May, 2020 03:22 AM

    Vladimir's Avatar

    Hi.
    I have the same issue when using Gitlab Ci environment. I dont have ipv6 connection.

    Gem::RemoteFetcher::UnknownHostError timed out (https://rubygems.org/gems/thread_safe-0.3.6.gem)
    Gem::RemoteFetcher::UnknownHostError timed out (https://rubygems.org/gems/erubis-2.7.0.gem)
    Gem::RemoteFetcher::UnknownHostError timed out (https://rubygems.org/gems/arel-6.0.4.gem)

    Any ideas ?

  5. Support Staff 5 Posted by sonalkr132 on 14 May, 2020 05:13 PM

    sonalkr132's Avatar

    Hi Vladimir,

    Gem::RemoteFetcher::UnknownHostError timed out

    we mostly see this issue on hosts with IPv6 addresses, please double-check this. It could also be possible the internet connection is broken for you environment. are you able to access sites other than rubygems.org? What is the output shown by curl -vv and wget commands to the same URLs? Also, are you able ping rubygems.org and ping 8.8.8.8?

    Please open a new ticket with your findings.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

20 Oct, 2020 07:13 PM
20 Oct, 2020 11:11 AM
13 Oct, 2020 06:14 PM
13 Oct, 2020 04:27 AM
06 Oct, 2020 08:22 AM