diff --git a/lib/pry/rubygem.rb b/lib/pry/rubygem.rb index f9efb97c..36f788da 100644 --- a/lib/pry/rubygem.rb +++ b/lib/pry/rubygem.rb @@ -23,7 +23,7 @@ class Pry Gem.source_index.find_name(name) end - first_spec = specs.sort_by{ |spec| Gem::Version.new(spec.version) }.first + first_spec = specs.sort_by{ |spec| Gem::Version.new(spec.version) }.last first_spec or raise CommandError, "Gem `#{name}` not found" end