Temporary solution for connection errors with rubygems

Posted . Visible to the public.

The problem

If you're experiencing that your bundle install command fails with an error message like this, rubygems.org might have issues with their ipv6 connectivity:

$ bundle install
Fetching source index from https://rubygems.org/

Retrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from https://rubygems.org/ due to underlying error <timed out (https://rubygems.org/specs.4.8.gz)>

The (a little bit dirty) possible solution

If that's actually the case, then you can try to deprioritize the ipv6 connection to the rubygems server, as described here Show archive.org snapshot .

To do so, simply add "precedence 2a04:4e42::0/32 5" to the bottom of your /etc/gai.conf file, and retry bundle install. Maybe the command will succeed now.

Warning

Don't forget to remove the line from the /etc/gai.conf file as soon as you don't need it anymore, so you don't have weird config laying around!

Jakob Scholz
Last edit
Jakob Scholz
License
Source code in this card is licensed under the MIT License.
Posted by Jakob Scholz to makandra dev (2022-10-18 07:47)