aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems.rb')
-rw-r--r--lib/rubygems.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/rubygems.rb b/lib/rubygems.rb
index b3b430283f..05690c83f9 100644
--- a/lib/rubygems.rb
+++ b/lib/rubygems.rb
@@ -9,7 +9,7 @@ require 'rbconfig'
require 'thread'
module Gem
- VERSION = '2.4.4'
+ VERSION = '2.4.5'
end
# Must be first since it unloads the prelude from 1.9.2
@@ -232,7 +232,13 @@ module Gem
requirements = Gem::Requirement.default if
requirements.empty?
- specs = Gem::Dependency.new(name, requirements).matching_specs(true)
+ dep = Gem::Dependency.new name, requirements
+
+ loaded = Gem.loaded_specs[name]
+
+ return loaded.bin_file exec_name if loaded && dep.matches_spec?(loaded)
+
+ specs = dep.matching_specs(true)
raise Gem::GemNotFoundException,
"can't find gem #{name} (#{requirements})" if specs.empty?