    # File lib/rubygems/uninstaller.rb, line 73
      def remove_executables(gemspec)
        return if gemspec.nil?

        if gemspec.executables.size > 0 then
          bindir = @bin_dir ? @bin_dir : (Gem.bindir @gem_home)

          list = Gem.source_index.search(gemspec.name).delete_if { |spec|
            spec.version == gemspec.version
          }

          executables = gemspec.executables.clone

          list.each do |spec|
            spec.executables.each do |exe_name|
              executables.delete(exe_name)
            end
          end

          return if executables.size == 0

          answer = if @force_executables.nil? then
                     ask_yes_no("Remove executables:\n" \
                                "\t#{gemspec.executables.join(", ")}\n\nin addition to the gem?",
                                true) # " # appease ruby-mode - don't ask
                   else
                     @force_executables
                   end

          unless answer then
            say "Executables and scripts will remain installed."
          else
            raise Gem::FilePermissionError, bindir unless File.writable? bindir

            gemspec.executables.each do |exe_name|
              say "Removing #{exe_name}"
              FileUtils.rm_f File.join(bindir, exe_name)
              FileUtils.rm_f File.join(bindir, "#{exe_name}.bat")
            end
          end
        end
      end