{"record":{"id":"6e337f6871772db7","repo":"puppetlabs/puppet","slug":"puppet-puppet-version-requires-ruby-puppet-o","errorCode":null,"errorMessage":"Puppet #{Puppet.version} requires Ruby #{Puppet::OLDEST_RECOMMENDED_RUBY_VERSION} or greater, found Ruby #{RUBY_VERSION.dup}.","messagePattern":"Puppet #(.+?) requires Ruby #(.+?) or greater, found Ruby #(.+?)\\.","errorType":"exception","errorClass":"LoadError","httpStatus":null,"severity":"critical","filePath":"lib/puppet.rb","lineNumber":8,"sourceCode":"# frozen_string_literal: true\n\nrequire_relative 'puppet/version'\nrequire_relative 'puppet/concurrent/synchronized'\n\nPuppet::OLDEST_RECOMMENDED_RUBY_VERSION = '3.1.0'\nif Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new(Puppet::OLDEST_RECOMMENDED_RUBY_VERSION)\n  raise LoadError, \"Puppet #{Puppet.version} requires Ruby #{Puppet::OLDEST_RECOMMENDED_RUBY_VERSION} or greater, found Ruby #{RUBY_VERSION.dup}.\"\nend\n\n$LOAD_PATH.extend(Puppet::Concurrent::Synchronized)\n\n# see the bottom of the file for further inclusions\n# Also see the new Vendor support - towards the end\n#\nrequire_relative 'puppet/error'\nrequire_relative 'puppet/util'\nrequire_relative 'puppet/util/autoload'\nrequire_relative 'puppet/settings'\nrequire_relative 'puppet/util/feature'\nrequire_relative 'puppet/util/suidmanager'\nrequire_relative 'puppet/util/run_mode'\nrequire_relative 'puppet/gettext/config'\nrequire_relative 'puppet/defaults'\n\n# Defines the `Puppet` module. There are different entry points into Puppet","sourceCodeStart":1,"sourceCodeEnd":26,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet.rb#L1-L26","documentation":"At the top of lib/puppet.rb, RUBY_VERSION is compared against Puppet::OLDEST_RECOMMENDED_RUBY_VERSION ('3.1.0' in this tree) and a LoadError is raised immediately on older interpreters. Nothing else in the gem loads past this check — puppet refuses to run on an unsupported Ruby at require time.","triggerScenarios":"require 'puppet' (or any puppet/puppetserver entry point loading it) under Ruby < 3.1.0: system Ruby 2.6/2.7 on CentOS 7 or Ubuntu 20.04; an rbenv/rvm shim resolving to an old default; the puppet gem installed onto a distro Ruby.","commonSituations":"Installing a modern puppet gem on an old distro Ruby; CI images pinned to legacy Rubies; switching from the all-in-one puppet-agent package to the gem and forgetting the bundled interpreter requirement.","solutions":["Run through the puppet-agent all-in-one package, which bundles a supported Ruby (invoke via /opt/puppetlabs/puppet/bin/ruby)","Install Ruby >= 3.1 (rbenv/rvm/distro package) and reinstall the puppet gem under that interpreter","Or pin a puppet major version matching your interpreter (e.g. Puppet 7 supports Ruby >= 2.7)","Confirm which interpreter is loading puppet: ruby -v, which ruby, gem env"],"exampleFix":"# before (system ruby 2.7)\ngem install puppet  # LoadError at require\n\n# after\nrbenv install 3.2.2 && rbenv local 3.2.2\ngem install puppet","handlingStrategy":"validation","validationCode":"required = '3.1.0'\nif Gem::Version.new(RUBY_VERSION) < Gem::Version.new(required)\n  abort \"puppet needs Ruby >= #{required}; running #{RUBY_VERSION} (#{RUBY_PATH})\"\nend\nrequire 'puppet'","typeGuard":null,"tryCatchPattern":"begin\n  require 'puppet'\nrescue LoadError => e\n  abort \"#{e.message} — switch to the puppet-agent ruby or upgrade Ruby\"\nend","preventionTips":["Pin the Ruby version in Gemfile (.ruby-version) matching the puppet major you use","Invoke puppet via the all-in-one package binaries, not the system gem, on managed hosts","Check 'ruby -v' and 'gem env home' in CI before bundle install of puppet"],"tags":["ruby","version","compatibility","puppet"],"backgroundTag":"runtime-version-unsupported","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}