pantry/projects/rubygems.org/user-install-post3.5.patch
Max Howell dd02ec2804
Fix gem 3.5.5; rename patches for readability
gem 3.5.5 fixed the bad location for this path
2024-01-18 16:55:23 -05:00

17 lines
697 B
Diff

diff -ru a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb
--- a/lib/rubygems/installer.rb 2023-12-15 18:44:02
+++ b/lib/rubygems/installer.rb 2023-12-15 19:04:30
@@ -691,6 +691,12 @@
@plugins_dir = File.join(@build_root, @plugins_dir.gsub(/^[a-zA-Z]:/, ""))
alert_warning "You build with buildroot.\n Build root: #{@build_root}\n Bin dir: #{@bin_dir}\n Gem home: #{@gem_home}\n Plugins dir: #{@plugins_dir}"
end
+
+ unless File.writable? @gem_home
+ @bin_dir = File.join(Gem.user_home, ".local/bin")
+ @gem_home = Gem.user_dir
+ @plugins_dir = File.join(Gem.user_dir, "plugins")
+ end
end
def check_that_user_bin_dir_is_in_path # :nodoc: