From fe7d8a26927376a3256c0d3c896381d8aee751c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Sat, 4 Jan 2020 13:04:10 +0100 Subject: Previous fix didn't work --- lib/bundler/shared_helpers.rb | 2 +- lib/bundler/source/git/git_proxy.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb index 6e83bc5ff4..5d134a4f86 100644 --- a/lib/bundler/shared_helpers.rb +++ b/lib/bundler/shared_helpers.rb @@ -111,7 +111,7 @@ module Bundler raise NoSpaceOnDeviceError.new(path, action) rescue *[const_get_safely(:ENOTSUP, Errno)].compact raise OperationNotSupportedError.new(path, action) - rescue Errno::EEXIST, Errno::ENOENT + rescue Errno::EEXIST, Errno::ENOENT, Errno::EINVAL raise rescue SystemCallError => e raise GenericSystemCallError.new(e, "There was an error accessing `#{path}`.") diff --git a/lib/bundler/source/git/git_proxy.rb b/lib/bundler/source/git/git_proxy.rb index 92aed4d0ef..3015635846 100644 --- a/lib/bundler/source/git/git_proxy.rb +++ b/lib/bundler/source/git/git_proxy.rb @@ -125,7 +125,7 @@ module Bundler end git_retry %(clone --no-checkout --quiet "#{path}" "#{destination}") File.chmod(((File.stat(destination).mode | 0o777) & ~File.umask), destination) - rescue Errno::EEXIST => e + rescue Errno::EEXIST, Errno::EINVAL => e file_path = e.message[%r{.*?((?:[a-zA-Z]:)?/.*)}, 1] raise GitError, "Bundler could not install a gem because it needs to " \ "create a directory, but a file exists - #{file_path}. Please delete " \ -- cgit v1.2.1