From d10e09b7e345c803c16e05ac3e75eb23749d4024 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Wed, 9 Oct 2024 12:28:57 +0200 Subject: [PATCH] [rubygems/rubygems] Add `Gem::Specification#gem_dir` back If old Bundler versions that unconditionally try to remove this method are run with RubyGems versions _without_ this method, Bundler crashes because it tries to remove a method that does not exist. We need to wait until RubyGems cannot install any Bundler versions that unconditionally remove this method. https://github.com/rubygems/rubygems/commit/98804d261d --- lib/rubygems/specification.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb index 4753186a83..e5541e57b1 100644 --- a/lib/rubygems/specification.rb +++ b/lib/rubygems/specification.rb @@ -1912,6 +1912,14 @@ class Gem::Specification < Gem::BasicSpecification @full_name ||= super end + ## + # Work around old bundler versions removing my methods + # Can be removed once RubyGems can no longer install Bundler 2.5 + + def gem_dir # :nodoc: + super + end + def gems_dir @gems_dir ||= File.join(base_dir, "gems") end