ruby/rubygems · error · TypeError

Array must be in [[spec, source], ...] form

Error message

Array must be in [[spec, source], ...] form

What it means

Error "Array must be in [[spec, source], ...] form" thrown in ruby/rubygems.

Source

Thrown at lib/rubygems/available_set.rb:31

    @remote = true
  end

  attr_reader :set

  def add(spec, source)
    @set << Tuple.new(spec, source)
    @sorted = nil
    self
  end

  def <<(o)
    case o
    when Gem::AvailableSet
      s = o.set
    when Array
      s = o.map do |sp,so|
        if !sp.is_a?(Gem::Specification) || !so.is_a?(Gem::Source)
          raise TypeError, "Array must be in [[spec, source], ...] form"
        end

        Tuple.new(sp,so)
      end
    else
      raise TypeError, "must be a Gem::AvailableSet"
    end

    @set += s
    @sorted = nil

    self
  end

  ##
  # Yields each Tuple in this AvailableSet

  def each

View on GitHub (pinned to 86cbb817a3)

When it happens

Trigger: Thrown at lib/rubygems/available_set.rb:31 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/2c58f3087c074403. Report an issue: GitHub.