{"record":{"id":"cfe921947ae9b3bc","repo":"ruby/rubygems","slug":"yaml-data-doesn-t-evaluate-to-gem-specification","errorCode":null,"errorMessage":"YAML data doesn't evaluate to gem specification","messagePattern":"YAML data doesn't evaluate to gem specification","errorType":"exception","errorClass":"Gem::Exception","httpStatus":null,"severity":"error","filePath":"lib/rubygems/specification.rb","lineNumber":1056,"sourceCode":"  # Special loader for YAML files.  When a Specification object is loaded\n  # from a YAML file, it bypasses the normal Ruby object initialization\n  # routine (#initialize).  This method makes up for that and deals with\n  # gems of different ages.\n  #\n  # +input+ can be anything that YAML.load() accepts: String or IO.\n\n  def self.from_yaml(input)\n    Gem.load_yaml\n\n    input = normalize_yaml_input input\n    spec = Gem::SafeYAML.safe_load input\n\n    if spec && spec.class == FalseClass\n      raise Gem::EndOfYAMLException\n    end\n\n    unless Gem::Specification === spec\n      raise Gem::Exception, \"YAML data doesn't evaluate to gem specification\"\n    end\n\n    spec.specification_version ||= NONEXISTENT_SPECIFICATION_VERSION\n    spec.reset_nil_attributes_to_default\n    spec.flatten_require_paths\n\n    spec\n  end\n\n  ##\n  # Return the latest specs, optionally including prerelease specs if\n  # +prerelease+ is true.\n\n  def self.latest_specs(prerelease = false)\n    specification_record.latest_specs(prerelease)\n  end\n\n  ##","sourceCodeStart":1038,"sourceCodeEnd":1074,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/rubygems/specification.rb#L1038-L1074","documentation":"Error \"YAML data doesn't evaluate to gem specification\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/rubygems/specification.rb:1056 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The YAML metadata does not contain a Gem::Specification; rebuild the gem with a current RubyGems"],"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"}