diff --git a/lib/rubygems/uninstaller.rb b/lib/rubygems/uninstaller.rb index ac5fbfc8cf..c96df2a085 100644 --- a/lib/rubygems/uninstaller.rb +++ b/lib/rubygems/uninstaller.rb @@ -133,7 +133,7 @@ class Gem::Uninstaller if index == list.size remove_all list - elsif index >= 0 && index < list.size + elsif index && index >= 0 && index < list.size uninstall_gem list[index] else say "Error: must enter a number [1-#{list.size + 1}]"