{"record":{"id":"e3629629c2e6ee60","repo":"ruby/rubygems","slug":"spec-name-requires-dependency","errorCode":null,"errorMessage":"#{spec.name} requires #{dependency}","messagePattern":"#(.+?) requires #(.+?)","errorType":"exception","errorClass":"Gem::InstallError","httpStatus":null,"severity":"error","filePath":"lib/rubygems/installer.rb","lineNumber":371,"sourceCode":"      Gem::Util.glob_files_in_dir(\"*.gemspec\", File.join(gem_home, \"specifications\")).each do |path|\n        spec = Gem::Specification.load path\n        specs << spec if spec\n      end\n\n      specs\n    end\n  end\n\n  ##\n  # Ensure that the dependency is satisfied by the current installation of\n  # gem.  If it is not an exception is raised.\n  #\n  # spec       :: Gem::Specification\n  # dependency :: Gem::Dependency\n\n  def ensure_dependency(spec, dependency)\n    unless installation_satisfies_dependency? dependency\n      raise Gem::InstallError, \"#{spec.name} requires #{dependency}\"\n    end\n    true\n  end\n\n  ##\n  # True if the gems in the system satisfy +dependency+.\n\n  def installation_satisfies_dependency?(dependency)\n    return true if @options[:development] && dependency.type == :development\n    return true if installed_specs.detect {|s| dependency.matches_spec? s }\n    return false if @only_install_dir\n    !dependency.matching_specs.empty?\n  end\n\n  ##\n  # The location of the spec file that is installed.\n  #\n","sourceCodeStart":353,"sourceCodeEnd":389,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/rubygems/installer.rb#L353-L389","documentation":"Error \"#{spec.name} requires #{dependency}\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/rubygems/installer.rb:371 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Install the missing dependency shown in the message first","Update the gem (or RubyGems) so a compatible dependency version can be resolved"],"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"}