Patch by MSP-Greg Fixes issues with updated RubyGems diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb index e9ad4d03d4..657f21296f 100644 --- a/lib/rubygems/installer.rb +++ b/lib/rubygems/installer.rb @@ -771,18 +771,19 @@ def app_script_text(bin_file_name) # return the stub script text used to launch the true Ruby script def windows_stub_script(bindir, bin_file_name) + rb_bindir = RbConfig::CONFIG["bindir"] # All comparisons should be case insensitive - if bindir.downcase == RbConfig::CONFIG["bindir"].downcase + if bindir.downcase == rb_bindir.downcase # stub & ruby.exe withing same folder. Portable <<-TEXT @ECHO OFF @"%~dp0ruby.exe" "%~dpn0" %* TEXT - elsif bindir.downcase.start_with? RbConfig::TOPDIR.downcase + elsif bindir.downcase.start_with? (RbConfig::TOPDIR || File.dirname(rb_bindir)).downcase # stub within ruby folder, but not standard bin. Not portable require 'pathname' from = Pathname.new bindir - to = Pathname.new RbConfig::CONFIG["bindir"] + to = Pathname.new rb_bindir rel = to.relative_path_from from <<-TEXT @ECHO OFF diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb index 194396321e..2584ac1e91 100755 --- a/tool/rbinstall.rb +++ b/tool/rbinstall.rb @@ -792,7 +792,8 @@ def install_default_gem(dir, srcdir) } gem_ext_dir = "#$extout/gems/#{CONFIG['arch']}" extensions_dir = Gem::StubSpecification.gemspec_stub("", gem_dir, gem_dir).extensions_dir - Gem::Specification.each_gemspec([srcdir+'/gems/*']) do |path| + dirs = Gem::Util.glob_files_in_dir "*/", "#{srcdir}/gems" + Gem::Specification.each_gemspec(dirs) do |path| spec = load_gemspec(path) next unless spec.platform == Gem::Platform::RUBY next unless spec.full_name == path[srcdir.size..-1][/\A\/gems\/([^\/]+)/, 1]