From e7d845b1d0154651962f34eefb37ffb0ac0c4e0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Mon, 16 Oct 2023 10:36:37 +0200 Subject: [PATCH] [rubygems/rubygems] Restore using old way of passing Ruby version to resolver We used `Bundler::RubyVersion.system.gem_version` for a long time, but I changed this to `Gem.ruby_version` at https://github.com/rubygems/rubygems/commit/94f96439438e. It's unclear why I did that though since I believe it was unrelated to the fix in there. Bootboot patches `Bundler::RubyVersion` to customize how Bundler works with Ruby versions, and that change broke that. Since it's unclear to me how to achieve what Bootboot is doing with the current code, and there was no strong reason for the change, let's restore it for now. https://github.com/rubygems/rubygems/commit/8ec36c6017 --- lib/bundler/definition.rb | 2 +- lib/bundler/source/metadata.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index 3815a55b04..761185ff21 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -885,7 +885,7 @@ module Bundler def metadata_dependencies @metadata_dependencies ||= [ - Dependency.new("Ruby\0", Gem.ruby_version), + Dependency.new("Ruby\0", Bundler::RubyVersion.system.gem_version), Dependency.new("RubyGems\0", Gem::VERSION), ] end diff --git a/lib/bundler/source/metadata.rb b/lib/bundler/source/metadata.rb index 524db9c204..4d27761365 100644 --- a/lib/bundler/source/metadata.rb +++ b/lib/bundler/source/metadata.rb @@ -5,7 +5,7 @@ module Bundler class Metadata < Source def specs @specs ||= Index.build do |idx| - idx << Gem::Specification.new("Ruby\0", Gem.ruby_version) + idx << Gem::Specification.new("Ruby\0", Bundler::RubyVersion.system.gem_version) idx << Gem::Specification.new("RubyGems\0", Gem::VERSION) do |s| s.required_rubygems_version = Gem::Requirement.default end