ruby/rubygems · error · ArgumentError

You must specify engine_version along with the Ruby engine

Error message

You must specify engine_version along with the Ruby engine

What it means

Error "You must specify engine_version along with the Ruby engine" thrown in ruby/rubygems.

Source

Thrown at lib/rubygems/request_set/gem_dependency_api.rb:787

  # #platform.

  alias_method :platforms, :platform

  ##
  # :category: Gem Dependencies DSL
  #
  # Restricts this gem dependencies file to the given ruby +version+.
  #
  # You may also provide +engine:+ and +engine_version:+ options to restrict
  # this gem dependencies file to a particular ruby engine and its engine
  # version.  This matching is performed by using the RUBY_ENGINE and
  # RUBY_ENGINE_VERSION constants.

  def ruby(version, options = {})
    engine         = options[:engine]
    engine_version = options[:engine_version]

    raise ArgumentError,
          "You must specify engine_version along with the Ruby engine" if
            engine && !engine_version

    return true if @installing

    unless version == RUBY_VERSION
      message = "Your Ruby version is #{RUBY_VERSION}, " \
                "but your #{gem_deps_file} requires #{version}"

      raise Gem::RubyVersionMismatch, message
    end

    if engine && engine != Gem.ruby_engine
      message = "Your Ruby engine is #{Gem.ruby_engine}, " \
                "but your #{gem_deps_file} requires #{engine}"

      raise Gem::RubyVersionMismatch, message
    end

View on GitHub (pinned to 86cbb817a3)

Solutions

  1. Add an engine_version entry alongside the ruby engine declaration in the dependencies file

When it happens

Trigger: Thrown at lib/rubygems/request_set/gem_dependency_api.rb:787 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/3a421df52716a71b. Report an issue: GitHub.