ruby/rubygems · error · ArgumentError

invalid override version requirement #{operation.inspect}: #

Error message

invalid override version requirement #{operation.inspect}: #{e.message}

What it means

Error "invalid override version requirement #{operation.inspect}: #{e.message}" thrown in ruby/rubygems.

Source

Thrown at lib/bundler/dsl.rb:312

      return if SUPPORTED_OVERRIDE_FIELDS.include?(field)
      supported = SUPPORTED_OVERRIDE_FIELDS.map {|f| "`#{f}:`" }.join(", ")
      raise ArgumentError, "unsupported override field `#{field}:`; supported fields: #{supported}"
    end

    def validate_override_operation!(operation)
      case operation
      when String
        Gem::Requirement.new(operation)
      when nil
        # ok
      when Symbol
        return if SUPPORTED_OVERRIDE_SYMBOL_OPERATIONS.include?(operation)
        raise ArgumentError, "unsupported override operation: #{operation.inspect}"
      else
        raise ArgumentError, "override operation must be a String, Symbol, or nil, got #{operation.inspect}"
      end
    rescue Gem::Requirement::BadRequirementError => e
      raise ArgumentError, "invalid override version requirement #{operation.inspect}: #{e.message}"
    end

    def validate_override_uniqueness!(target, field)
      return unless @overrides.any? {|o| o.target == target && o.field == field }
      raise ArgumentError, "duplicate override for #{target.inspect} `#{field}:`"
    end

    def add_dependency(name, version = nil, options = {})
      options["gemfile"] = @gemfile
      options["source"] ||= @source
      options["env"] ||= @env

      dep = Dependency.new(name, version, options)

      # if there's already a dependency with this name we try to prefer one
      if current = @dependencies.find {|d| d.name == name }
        if current.requirement != dep.requirement
          current_requirement_open = current.requirements_list.include?(">= 0")

View on GitHub (pinned to 86cbb817a3)

When it happens

Trigger: Thrown at lib/bundler/dsl.rb:312 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/92f0a648d8d01d0a. Report an issue: GitHub.