{"record":{"id":"cb15d8c2676f6b02","repo":"ruby/rubygems","slug":"uninstallation-aborted-due-to-dependent-gem-s","errorCode":null,"errorMessage":"Uninstallation aborted due to dependent gem(s)","messagePattern":"Uninstallation aborted due to dependent gem\\(s\\)","errorType":"exception","errorClass":"Gem::DependencyRemovalException","httpStatus":null,"severity":"error","filePath":"lib/rubygems/uninstaller.rb","lineNumber":163,"sourceCode":"        uninstall_gem list[index]\n      else\n        say \"Error: must enter a number [1-#{list.size + 1}]\"\n      end\n    else\n      uninstall_gem list.first\n    end\n  end\n\n  ##\n  # Uninstalls gem +spec+\n\n  def uninstall_gem(stub)\n    spec = stub.to_spec\n\n    @spec = spec\n\n    unless dependencies_ok? spec\n      if abort_on_dependent? || !ask_if_ok(spec)\n        raise Gem::DependencyRemovalException,\n          \"Uninstallation aborted due to dependent gem(s)\"\n      end\n    end\n\n    Gem.pre_uninstall_hooks.each do |hook|\n      hook.call self\n    end\n\n    remove_executables @spec\n    remove_plugins @spec\n    remove @spec\n\n    specification_record.remove_spec(stub)\n\n    regenerate_plugins\n\n    Gem.post_uninstall_hooks.each do |hook|","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/rubygems/uninstaller.rb#L145-L181","documentation":"Error \"Uninstallation aborted due to dependent gem(s)\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/rubygems/uninstaller.rb:163 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Uninstall the dependent gems first, then retry","Or force it with `gem uninstall --force` (may break dependents)"],"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"}