{"record":{"id":"3a421df52716a71b","repo":"ruby/rubygems","slug":"you-must-specify-engine-version-along-with-the-rub","errorCode":null,"errorMessage":"You must specify engine_version along with the Ruby engine","messagePattern":"You must specify engine_version along with the Ruby engine","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/rubygems/request_set/gem_dependency_api.rb","lineNumber":787,"sourceCode":"  # #platform.\n\n  alias_method :platforms, :platform\n\n  ##\n  # :category: Gem Dependencies DSL\n  #\n  # Restricts this gem dependencies file to the given ruby +version+.\n  #\n  # You may also provide +engine:+ and +engine_version:+ options to restrict\n  # this gem dependencies file to a particular ruby engine and its engine\n  # version.  This matching is performed by using the RUBY_ENGINE and\n  # RUBY_ENGINE_VERSION constants.\n\n  def ruby(version, options = {})\n    engine         = options[:engine]\n    engine_version = options[:engine_version]\n\n    raise ArgumentError,\n          \"You must specify engine_version along with the Ruby engine\" if\n            engine && !engine_version\n\n    return true if @installing\n\n    unless version == RUBY_VERSION\n      message = \"Your Ruby version is #{RUBY_VERSION}, \" \\\n                \"but your #{gem_deps_file} requires #{version}\"\n\n      raise Gem::RubyVersionMismatch, message\n    end\n\n    if engine && engine != Gem.ruby_engine\n      message = \"Your Ruby engine is #{Gem.ruby_engine}, \" \\\n                \"but your #{gem_deps_file} requires #{engine}\"\n\n      raise Gem::RubyVersionMismatch, message\n    end","sourceCodeStart":769,"sourceCodeEnd":805,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/rubygems/request_set/gem_dependency_api.rb#L769-L805","documentation":"Error \"You must specify engine_version along with the Ruby engine\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/rubygems/request_set/gem_dependency_api.rb:787 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add an engine_version entry alongside the ruby engine declaration in the dependencies file"],"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"}