{"record":{"id":"e5f21287734ebb33","repo":"ruby/rubygems","slug":"unable-to-find-gemspec-for-gem-name","errorCode":null,"errorMessage":"unable to find #{gemspec} for gem #{name}","messagePattern":"unable to find #(.+?) for gem #(.+?)","errorType":"exception","errorClass":"Gem::GemNotFoundException","httpStatus":null,"severity":"error","filePath":"lib/rubygems/resolver/vendor_set.rb","lineNumber":40,"sourceCode":"  attr_reader :specs # :nodoc:\n\n  def initialize # :nodoc:\n    super()\n\n    @directories = {}\n    @specs       = {}\n  end\n\n  ##\n  # Adds a specification to the set with the given +name+ which has been\n  # unpacked into the given +directory+.\n\n  def add_vendor_gem(name, directory) # :nodoc:\n    gemspec = File.join directory, \"#{name}.gemspec\"\n\n    spec = Gem::Specification.load gemspec\n\n    raise Gem::GemNotFoundException,\n          \"unable to find #{gemspec} for gem #{name}\" unless spec\n\n    spec.full_gem_path = File.expand_path directory\n\n    @specs[spec.name]  = spec\n    @directories[spec] = directory\n\n    spec\n  end\n\n  ##\n  # Returns an Array of VendorSpecification objects matching the\n  # DependencyRequest +req+.\n\n  def find_all(req)\n    @specs.values.select do |spec|\n      req.match? spec\n    end.map do |spec|","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/rubygems/resolver/vendor_set.rb#L22-L58","documentation":"Error \"unable to find #{gemspec} for gem #{name}\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/rubygems/resolver/vendor_set.rb:40 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run `gem build <name>.gemspec` in the vendored gem directory to produce the .gem file","Check that the vendored path actually contains the gem's gemspec"],"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"}