{"record":{"id":"22796b6bdd57f00c","repo":"ruby/rubygems","slug":"gem-is-not-installed-in-gem-home-try","errorCode":null,"errorMessage":"#{@gem} is not installed in GEM_HOME, try:","messagePattern":"#(.+?) is not installed in GEM_HOME, try:","errorType":"exception","errorClass":"Gem::InstallError","httpStatus":null,"severity":"error","filePath":"lib/rubygems/uninstaller.rb","lineNumber":131,"sourceCode":"\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\n      message = [\"#{@gem} is not installed in GEM_HOME, try:\"]\n      message.concat other_repos.map {|repo|\n        \"\\tgem uninstall -i #{repo} #{@gem}\"\n      }\n\n      raise Gem::InstallError, message.join(\"\\n\")\n    elsif @force_all\n      remove_all list\n\n    elsif list.size > 1\n      gem_names = list.map(&:full_name_with_location)\n      gem_names << \"All versions\"\n\n      say\n      _, index = choose_from_list \"Select gem to uninstall:\", gem_names\n\n      if index == list.size\n        remove_all list\n      elsif index && index >= 0 && index < list.size\n        uninstall_gem list[index]\n      else\n        say \"Error: must enter a number [1-#{list.size + 1}]\"\n      end\n    else","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/rubygems/uninstaller.rb#L113-L149","documentation":"Error \"#{@gem} is not installed in GEM_HOME, try:\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/rubygems/uninstaller.rb:131 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Follow the suggested command in the output (add the shown -I path or fix GEM_HOME)","Or uninstall from the gem home where it is actually installed"],"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"}