From 437a4ccbf2e944a7029fc55df789e0fbb945f162 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Thu, 27 Jul 2023 23:01:00 +0200 Subject: [PATCH] [rubygems/rubygems] Restore support for Pathname objects in the replaced require https://github.com/rubygems/rubygems/commit/f7b4282ef7 --- lib/bundler/rubygems_integration.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index 4a69329852..e2d805d0ed 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -249,7 +249,7 @@ module Bundler [::Kernel.singleton_class, ::Kernel].each do |kernel_class| kernel_class.send(:alias_method, :no_warning_require, :require) kernel_class.send(:define_method, :require) do |file| - name = file.tr("/", "-") + name = file.to_s.tr("/", "-") if (::Gem::BUNDLED_GEMS.keys - specs.to_a.map(&:name)).include?(name) unless $LOADED_FEATURES.any? {|f| f.end_with?("#{name}.rb", "#{name}.#{RbConfig::CONFIG["DLEXT"]}") } target_file = begin