For some reason rubygems.org is not available when I try bundle install or ping rubygems.org from my new ubuntu/debian linode - what did I do wrong?

I was installing all the tools for rails but ran into this problem when trying to run bundle install always failing due to unable to connect to rubygems.org, so since I did not get that far, I simply rebuilt the server with Ubuntu 18.04 LTS and had the same rubygems.org problem right away. Just to see if it was anything different with Debian 9 I tried that and got the same problem accessing rubygems.org. This linode is in Fremont.
I have a Ubuntu 16.04 LTS server in Dallas that has no problem accessing rubygems.org.

3 Replies

What is the error? Does it resolve? Does it ping?

ping always gets 100% packet loss, but curl works.
All other websites work with both ping and curl.

The error with bundler is:
Retrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from https://rubygems.org/

I found this from a simple search on the error but there is of course no VPN like the OP's problem
https://stackoverflow.com/questions/38410185/bundle-install-is-not-working#38410872

I ran into something similar earlier today, specifically api.rubygems.org was not responding to pings and failed to connect over IPv6. It appears that this isn't an issue with Linode or your server, rather it's an issue with api.rubygems.org.

Until this is fixed on their side of things, one solution is to modify the /etc/gai.conf to lower the priority of api.rubygem.org's IPv6 addresses. This means that your system will first attempt a connection over IPv4.

To do this, uncomment out the default labels and then add the following line for each IPv6 address you'd like to lower the precedence for.

precedence  <<Insert IPv6 Address>>  5

Keep in mind that the IPv6 addresses for api.rubygems.org may change. Putting it all together, this worked for me:

precedence  2a04:4e42::70/128       5
precedence  2a04:4e42:200::70/128   5
precedence  2a04:4e42:400::70/128   5
precedence  2a04:4e42:600::70/128   5

For reference, here's Stack Overflow article that initially provided me with the solution:

https://stackoverflow.com/questions/49800432/gem-cannot-access-rubygems-org/50349235#50349235

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct