# File lib/rubygems/commands/which_command.rb, line 34
  def execute
    searcher = Gem::GemPathSearcher.new

    options[:args].each do |arg|
      dirs = $LOAD_PATH
      spec = searcher.find arg

      if spec then
        if options[:search_gems_first] then
          dirs = gem_paths(spec) + $LOAD_PATH
        else
          dirs = $LOAD_PATH + gem_paths(spec)
        end

        say "(checking gem #{spec.full_name} for #{arg})" if
          Gem.configuration.verbose and $stdout.tty?
      end

      paths = find_paths arg, dirs

      if paths.empty? then
        say "Can't find ruby library file or shared library #{arg}"
      else
        say paths
      end
    end
  end