Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The annoying 'Network error while fetching' while bundle install

I'm trying to install the newest version of gitlab. When I try

sudo -u git -H bundle install --deployment --without development test mysql was --verbose

It always shows an error Network error while fetching, and re-fetches all the packages again when I retry, then the error appears again because my network is not stable. How to tell the bundler not to fetch packages already fetched?

like image 665
Dawei Yang Avatar asked Jan 10 '23 12:01

Dawei Yang


1 Answers

Try adding the bundle install --retry option:

sudo -u git -H bundle install --retry 4 --deployment --without development test mysql was --verbose

This will retry failed network requests 4 times. From the Bundler Documentation:

--retry: Retry network and git requests that have failed.

Note: if it complains about Unknown switches '--retry', then your bundler version is very old. update it with:

gem update bundler

and then try again.

like image 169
Tamer Shlash Avatar answered Jan 23 '23 02:01

Tamer Shlash