ruby/rubygems · error · Gem::Exception

Failed to find gems #{options[:args]} #{options[:version]}

Error message

Failed to find gems #{options[:args]} #{options[:version]}

What it means

Error "Failed to find gems #{options[:args]} #{options[:version]}" thrown in ruby/rubygems.

Source

Thrown at lib/rubygems/commands/pristine_command.rb:140

        spec.extensions && !spec.extensions.empty?
      end
    elsif options[:only_missing_extensions]
      specification_record.select(&:missing_extensions?)
    else
      get_all_gem_names.sort.flat_map do |gem_name|
        specification_record.find_all_by_name(gem_name, options[:version]).reverse
      end
    end

    specs = specs.select {|spec| spec.platform == RUBY_ENGINE || Gem::Platform.local === spec.platform || spec.platform == Gem::Platform::RUBY }

    if specs.to_a.empty?
      if options[:only_missing_extensions]
        say "No gems with missing extensions to restore"
        return
      end

      raise Gem::Exception,
            "Failed to find gems #{options[:args]} #{options[:version]}"
    end

    say "Restoring gems to pristine condition..."

    specs.group_by(&:full_name_with_location).values.each do |grouped_specs|
      spec = grouped_specs.find {|s| !s.default_gem? } || grouped_specs.first

      only_executables = options[:only_executables]
      only_plugins = options[:only_plugins]

      unless only_executables || only_plugins
        # Default gemspecs include changes provided by ruby-core installer that
        # can't currently be pristined (inclusion of compiled extension targets in
        # the file list). So stick to resetting executables if it's a default gem.
        only_executables = true if spec.default_gem?
      end

View on GitHub (pinned to 86cbb817a3)

When it happens

Trigger: Thrown at lib/rubygems/commands/pristine_command.rb:140 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ruby/rubygems@86cbb817a3 (2026-08-23). Data as JSON: /api/errors/1ccec4b6d57a5501. Report an issue: GitHub.