diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index a083247adc4..c1bb6c7ab84 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -277,7 +277,9 @@ def build_gem(gem_dir, spec) def download_gem(spec, uri, path) uri = Bundler.settings.mirror_for(uri) fetcher = Gem::RemoteFetcher.new(configuration[:http_proxy]) - fetcher.download(spec, uri, path) + Bundler::Retry.new("download gem #{uri}", Gem::RemoteFetcher::FetchError).attempts do + fetcher.download(spec, uri, path) + end end def security_policy_keys