{"record":{"id":"1ccec4b6d57a5501","repo":"ruby/rubygems","slug":"failed-to-find-gems-options-args-options-v","errorCode":null,"errorMessage":"Failed to find gems #{options[:args]} #{options[:version]}","messagePattern":"Failed to find gems #(.+?) #(.+?)","errorType":"exception","errorClass":"Gem::Exception","httpStatus":null,"severity":"error","filePath":"lib/rubygems/commands/pristine_command.rb","lineNumber":140,"sourceCode":"        spec.extensions && !spec.extensions.empty?\n      end\n    elsif options[:only_missing_extensions]\n      specification_record.select(&:missing_extensions?)\n    else\n      get_all_gem_names.sort.flat_map do |gem_name|\n        specification_record.find_all_by_name(gem_name, options[:version]).reverse\n      end\n    end\n\n    specs = specs.select {|spec| spec.platform == RUBY_ENGINE || Gem::Platform.local === spec.platform || spec.platform == Gem::Platform::RUBY }\n\n    if specs.to_a.empty?\n      if options[:only_missing_extensions]\n        say \"No gems with missing extensions to restore\"\n        return\n      end\n\n      raise Gem::Exception,\n            \"Failed to find gems #{options[:args]} #{options[:version]}\"\n    end\n\n    say \"Restoring gems to pristine condition...\"\n\n    specs.group_by(&:full_name_with_location).values.each do |grouped_specs|\n      spec = grouped_specs.find {|s| !s.default_gem? } || grouped_specs.first\n\n      only_executables = options[:only_executables]\n      only_plugins = options[:only_plugins]\n\n      unless only_executables || only_plugins\n        # Default gemspecs include changes provided by ruby-core installer that\n        # can't currently be pristined (inclusion of compiled extension targets in\n        # the file list). So stick to resetting executables if it's a default gem.\n        only_executables = true if spec.default_gem?\n      end\n","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/rubygems/commands/pristine_command.rb#L122-L158","documentation":"Error \"Failed to find gems #{options[:args]} #{options[:version]}\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/rubygems/commands/pristine_command.rb:140 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"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"}