diff --git a/lib/rubygems/commands/which_command.rb b/lib/rubygems/commands/which_command.rb index 18706af..705c154 100644 --- a/lib/rubygems/commands/which_command.rb +++ b/lib/rubygems/commands/which_command.rb @@ -36,6 +36,7 @@ requiring to see why it does not behave as you expect. def execute found = false + missing = false options[:args].each do |arg| arg = arg.sub(/#{Regexp.union(*Gem.suffixes)}$/, '') @@ -56,13 +57,14 @@ requiring to see why it does not behave as you expect. if paths.empty? then alert_error "Can't find ruby library file or shared library #{arg}" + missing = true else say paths found = true end end - terminate_interaction 1 unless found + terminate_interaction 1 unless found and not missing end def find_paths(package_name, dirs)