summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2026-04-08 17:07:26 +0900
committerTakashi Kokubun <takashikkbn@gmail.com>2026-04-08 15:49:38 -0700
commit019c261cd7128a6b9d2a6dd977865af268a435e0 (patch)
treeb78f96a0ad91421e517f30bec48db0bf945cd3d6
parent7ba583d753411a39dec78ea6e7c8d2701b04c118 (diff)
Merge RubyGems/Bundler 4.0.6
-rw-r--r--lib/rubygems.rb3
-rw-r--r--test/rubygems/test_gem.rb22
2 files changed, 1 insertions, 24 deletions
diff --git a/lib/rubygems.rb b/lib/rubygems.rb
index a99aec3f97..c0aacfc31b 100644
--- a/lib/rubygems.rb
+++ b/lib/rubygems.rb
@@ -192,9 +192,8 @@ module Gem
begin
spec.activate
rescue Gem::LoadError => e # this could fail due to gem dep collisions, go lax
- name = spec.name
spec = Gem::Specification.find_unloaded_by_path(path)
- spec ||= Gem::Specification.find_by_name(name)
+ spec ||= Gem::Specification.find_by_name(spec.name)
if spec.nil?
raise e
else
diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb
index 4293bc5ba8..74c8953904 100644
--- a/test/rubygems/test_gem.rb
+++ b/test/rubygems/test_gem.rb
@@ -1213,28 +1213,6 @@ class TestGem < Gem::TestCase
assert Gem.try_activate("b"), "try_activate should still return true"
end
- def test_try_activate_does_not_raise_no_method_error_on_activation_conflict
- a1 = util_spec "a", "1.0" do |s|
- s.files << "lib/a/old.rb"
- end
-
- a2 = util_spec "a", "2.0" do |s|
- s.files << "lib/a/old.rb"
- s.files << "lib/a/new_file.rb"
- end
-
- install_specs a1, a2
-
- # Activate the older version
- gem "a", "= 1.0"
-
- # try_activate a file only in the newer version should not raise
- # NoMethodError on nil (https://bugs.ruby-lang.org/issues/21954)
- assert_nothing_raised do
- Gem.try_activate("a/new_file")
- end
- end
-
def test_spec_order_is_consistent
b1 = util_spec "b", "1.0"
b2 = util_spec "b", "2.0"