puppetlabs/puppet · error · ArgumentError
Gem not found
Error message
Gem not found '%{gem_name}' What it means
GemSupport#gem_dir_from_name: find_by_name returned no specification for the plain gem name string, so its root directory cannot be produced.
Solutions
- Install the gem (gem install <name>)
- Check the gem name for typos
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at lib/puppet/pops/loader/gem_support.rb:49 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of puppetlabs/puppet@e227c27540 (2026-08-21).
Data as JSON: /api/errors/789a65e9304d2c39.
Report an issue: GitHub.
Appendix: source
Thrown at lib/puppet/pops/loader/gem_support.rb:49
unless spec
raise ArgumentError, _("Gem not found %{uri}") % { uri: uri }
end
# if path given append that, else append given subdir
if uri.path.empty?
spec.gem_dir
else
File.join(spec.full_gem_path, uri.path)
end
end
# Produces the root directory of a gem given as a string with the gem's name.
# TODO: FIND by name raises exception Gem::LoadError with list of all gems on the path
#
def gem_dir_from_name(gem_name)
spec = Gem::Specification.find_by_name(gem_name)
unless spec
raise ArgumentError, _("Gem not found '%{gem_name}'") % { gem_name: gem_name }
end
spec.full_gem_path
end
end
View on GitHub (pinned to e227c27540)