{"record":{"id":"5e44f32f89b53e76","repo":"ruby/rubygems","slug":"gem-gem-inspect-is-not-installed","errorCode":null,"errorMessage":"gem #{@gem.inspect} is not installed","messagePattern":"gem #(.+?) is not installed","errorType":"exception","errorClass":"Gem::InstallError","httpStatus":null,"severity":"error","filePath":"lib/rubygems/uninstaller.rb","lineNumber":107,"sourceCode":"  end\n\n  ##\n  # Performs the uninstall of the gem.  This removes the spec, the Gem\n  # directory, and the cached .gem file.\n\n  def uninstall\n    dependency = Gem::Dependency.new @gem, @version\n\n    list = []\n\n    specification_record.stubs.each do |spec|\n      next unless dependency.matches_spec? spec\n\n      list << spec\n    end\n\n    if list.empty?\n      raise Gem::InstallError, \"gem #{@gem.inspect} is not installed\"\n    end\n\n    default_specs, list = list.partition(&:default_gem?)\n    warn_cannot_uninstall_default_gems(default_specs - list)\n    @default_specs_matching_uninstall_params = default_specs.map(&:to_spec)\n\n    list, other_repo_specs = list.partition do |spec|\n      @gem_home == spec.base_dir ||\n        (@user_install && spec.base_dir == @user_dir)\n    end\n\n    list.sort!\n\n    if list.empty?\n      return unless other_repo_specs.any?\n\n      other_repos = other_repo_specs.map(&:base_dir).uniq\n","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/rubygems/uninstaller.rb#L89-L125","documentation":"Error \"gem #{@gem.inspect} is not installed\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/rubygems/uninstaller.rb:107 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the gem name with `gem list` and uninstall the installed name","Specify the exact version with `-v` if multiple versions exist"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"86cbb817a38ce8477b181c17467a703ded3f2be8","analyzedAt":"2026-08-23T06:27:48.159Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}