# File lib/rubygems/uninstaller.rb, line 99
  def uninstall_gem(spec)
    @spec = spec

    unless dependencies_ok? spec
      unless ask_if_ok(spec)
        raise Gem::DependencyRemovalException,
          "Uninstallation aborted due to dependent gem(s)"
      end
    end

    Gem.pre_uninstall_hooks.each do |hook|
      hook.call self
    end

    remove_executables @spec
    remove @spec

    Gem.post_uninstall_hooks.each do |hook|
      hook.call self
    end

    @spec = nil
  end