{"record":{"id":"55ead66feb0979b7","repo":"puppetlabs/puppet","slug":"gem-not-found-uri","errorCode":null,"errorMessage":"Gem not found %{uri}","messagePattern":"Gem not found %(.+?)","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/pops/loader/gem_support.rb","lineNumber":32,"sourceCode":"  # gemname as a string.\n  #\n  def gem_dir(uri_or_string)\n    case uri_or_string\n    when URI\n      gem_dir_from_uri(uri_or_string)\n    when String\n      gem_dir_from_name(uri_or_string)\n    end\n  end\n\n  # Produces the root directory of a gem given as an uri, where hostname is the gemname, and an optional\n  # path is appended to the root of the gem (i.e. if the reference is given to a sub-location within a gem.\n  # TODO: FIND by name raises exception Gem::LoadError with list of all gems on the path\n  #\n  def gem_dir_from_uri(uri)\n    spec = Gem::Specification.find_by_name(uri.hostname)\n    unless spec\n      raise ArgumentError, _(\"Gem not found %{uri}\") % { uri: uri }\n    end\n\n    # if path given append that, else append given subdir\n    if uri.path.empty?\n      spec.gem_dir\n    else\n      File.join(spec.full_gem_path, uri.path)\n    end\n  end\n\n  # Produces the root directory of a gem given as a string with the gem's name.\n  # TODO: FIND by name raises exception Gem::LoadError with list of all gems on the path\n  #\n  def gem_dir_from_name(gem_name)\n    spec = Gem::Specification.find_by_name(gem_name)\n    unless spec\n      raise ArgumentError, _(\"Gem not found '%{gem_name}'\") % { gem_name: gem_name }\n    end","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/pops/loader/gem_support.rb#L14-L50","documentation":"Error \"Gem not found %{uri}\" thrown in puppetlabs/puppet.","triggerScenarios":"Thrown at lib/puppet/pops/loader/gem_support.rb:32 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-22T04:17:13.399Z"}