Project

General

Profile

« Previous | Next » 

Revision 0e808183

Added by deivid (David Rodríguez) about 2 years ago

[rubygems/rubygems] Allow standalone mode to work on a Windows edge case

If a gem is located in a different drive than the Gemfile, standalone
mode will fail to generate the bundler/setup script, failing with an
error like

ArgumentError: different prefix: "C:/" and "D:/a/rubygems/rubygems/bundler/tmp/2/bundled_app/bundle/bundler" C:/hostedtoolcache/windows/Ruby/3.0.5/x64/lib/ruby/3.0.0/pathname.rb:528:in `relative_path_from' D:/a/rubygems/rubygems/bundler/tmp/2/gems/system/gems/bundler-2.4.20/lib/bundler/installer/standalone.rb:58:in `gem_path' D:/a/rubygems/rubygems/bundler/tmp/2/gems/system/gems/bundler-2.4.20/lib/bundler/installer/standalone.rb:33:in `block (2 levels) in paths' D:/a/rubygems/rubygems/bundler/tmp/2/gems/system/gems/bundler-2.4.20/lib/bundler/installer/standalone.rb:32:in `map' D:/a/rubygems/rubygems/bundler/tmp/2/gems/system/gems/bundler-2.4.20/lib/bundler/installer/standalone.rb:32:in `block in paths' 

I'm fixing this by falling back to using a full path in this case.

This was caught by a failing spec, so I'm not adding new specs.

https://github.com/rubygems/rubygems/commit/3cb9b9ab7a