1

I am getting a timeout error trying to update my gems. I would prefer not to have to change to unsecured paths.

I can download the gems individually from rubygems using my browser - but gem update and rvm gemset update both fail with the following error:

ERROR: While executing gem ... (Gem::RemoteFetcher::UnknownHostError) timed out (https://api.rubygems.org/latest_specs.4.8.gz)

When I run bundle update - I run into individual gems timing out (hence knowing I can download and install them individually), as an example:

Gem::RemoteFetcher::UnknownHostError: timed out (https://rubygems.org/gems/ffi-1.9.23.gem) An error occurred while installing ffi (1.9.23), and Bundler cannot continue. Make sure that gem install ffi -v '1.9.23' succeeds before bundling.

I have followed these posts:

  1. SSL Error When installing rubygems, Unable to pull data from 'https://rubygems.org/

  2. https://rubygems.org/pages/download#formats

emecas
  • 1,586
  • 3
  • 27
  • 43

2 Answers2

4

I got it solved by simple switching by wifi on/off on my Macbook Pro with OSx Mojave.

Diego Charles
  • 103
  • 12
0

the rubygems host server sometimes have problems dealing with ipv6.

Basically i have changed my preference from ipv6 to ipv4 in windows 10. That must help for other systems to.

For WINDOWS you'll do as follows:

  1. check your prefixpolicies:

    • run

      netsh insterface ipv6 show prefixpolicies
      
    • the output should be something like this:

      Precedence label Prefix
      
      ----------  -----  --------------------------------
      
      50      0  ::1/128
      40      1  ::/0        
      30      2  2002::/16
      20      4  ::ffff:0:0/96
      

The higher the number of precedence, higher the priority.

So as you see, ipv6 ::/0 is right next to the localhost as the second priority.

  1. Let's put ipv4 in a higher preference.

    • run:

      netsh interface ipv6 set prefixpolicies ::ffff:0:0/96 46 4
      

After running this comand, try looking the prefixpolicies again.

You will find ipv4 in a higher precedence now, with 46 beeing higher than 40 from ipv6.

  1. Now try reaching for the rubygem host running any "gem" command, you will probably be very pleased.