Skip to content

Instantly share code, notes, and snippets.

@zulhfreelancer
Last active October 30, 2023 05:34
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save zulhfreelancer/e8eb723e97a818b6727fb53bd94a0a96 to your computer and use it in GitHub Desktop.
How to fix bundle install 'network error while fetching' issue on Mac OSX?

If you get something like this when running bundle install...

Network error while fetching https://rubygems.org/quick/Marshal.4.8/xxx-x.x.x.gemspec.rz (execution expired)

...this solution might work for you.

First, make sure you have tried all the troubleshoot solutions here.

Next, please also make sure you are using the latest cacert.pem file. You can download it from here. In my case, I saved it at /usr/local/etc/openssl/certs/cacert.pem.

If it's still doesn't work, you can try disabling IPv6 in your Mac.

$ networksetup -setv6off Wi-Fi

Result:

Of course, if you need the IPv6 again, run the following command:

$ networksetup -setv6automatic Wi-Fi

Result:

In my case, the bundle install command worked after I disabled IPv6. Strange, right?

Tweet me if this solution works for you!

Copy link

ghost commented May 21, 2019

It worked for on Windows 10 as well by disabling the IPv6 box as shown in the picture:

2019-05-21_15h49_37

Thank you!

@GorgonUK
Copy link

GorgonUK commented Feb 25, 2020

@fabricio-garcia & @zulhfreelancer

Thank you! I'm using Windows and It worked for me aswell.

-George

@0x-genesys
Copy link

worked for me too

@Stankovskij
Copy link

$ networksetup -setv6off Wi-Fi worked for me. Thanks!

@called2voyage
Copy link

Using Ubuntu 20.04 and disabling IPv6 worked for me too.

@aniketacima
Copy link

For Ubuntu to disable ipv6

sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment