diff options
-rw-r--r-- | lib/bundler/fetcher.rb | 3 | ||||
-rw-r--r-- | lib/bundler/fetcher/index.rb | 3 | ||||
-rw-r--r-- | spec/support/path.rb | 5 |
3 files changed, 7 insertions, 4 deletions
diff --git a/lib/bundler/fetcher.rb b/lib/bundler/fetcher.rb index d21baf659d..8084a530d1 100644 --- a/lib/bundler/fetcher.rb +++ b/lib/bundler/fetcher.rb @@ -99,7 +99,8 @@ module Bundler uri = URI.parse("#{remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}.rz") if uri.scheme == "file" - Bundler.load_marshal Bundler.rubygems.inflate(Gem.read_binary(uri.path)) + path = Gem.win_platform? ? uri.path[1..-1] : uri.path + Bundler.load_marshal Bundler.rubygems.inflate(Gem.read_binary(path)) elsif cached_spec_path = gemspec_cached_path(spec_file_name) Bundler.load_gemspec(cached_spec_path) else diff --git a/lib/bundler/fetcher/index.rb b/lib/bundler/fetcher/index.rb index 9beb0e27d8..d10c21b041 100644 --- a/lib/bundler/fetcher/index.rb +++ b/lib/bundler/fetcher/index.rb @@ -30,7 +30,8 @@ module Bundler uri = URI.parse("#{remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}.rz") if uri.scheme == "file" - Bundler.load_marshal Bundler.rubygems.inflate(Gem.read_binary(uri.path)) + path = Gem.win_platform? ? uri.path[1..-1] : uri.path + Bundler.load_marshal Bundler.rubygems.inflate(Gem.read_binary(path)) elsif cached_spec_path = gemspec_cached_path(spec_file_name) Bundler.load_gemspec(cached_spec_path) else diff --git a/spec/support/path.rb b/spec/support/path.rb index 28682a1f25..ca05ef5e3b 100644 --- a/spec/support/path.rb +++ b/spec/support/path.rb @@ -64,10 +64,11 @@ module Spec def file_uri_for(path) protocol = "file://" + root = Gem.win_platform? ? "/" : "" - return protocol + "localhost" + path.to_s if RUBY_VERSION < "2.5" + return protocol + "localhost" + root + path.to_s if RUBY_VERSION < "2.5" - protocol + path.to_s + protocol + root + path.to_s end def gem_repo1(*args) |