Puppet 3.* not compatible with Ruby 2.2.*

Puppet 3.* will not work out of the box with Ruby 2.2. The following error results from the attempt:

/usr/local/rvm/gems/ruby-2.2.1/gems/puppet-3.8.2/lib/puppet/vendor/safe_yaml/lib/safe_yaml/syck_node_monkeypatch.rb:42:in `': uninitialized con
stant Syck (NameError)
        from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/puppet-3.8.2/lib/puppet/vendor/safe_yaml/lib/safe_yaml.rb:197:in `'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/puppet-3.8.2/lib/puppet/vendor/safe_yaml/lib/safe_yaml.rb:132:in `'
        from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/puppet-3.8.2/lib/puppet/vendor/require_vendored.rb:4:in `'
        from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/puppet-3.8.2/lib/puppet/vendor.rb:40:in `require_libs'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/puppet-3.8.2/lib/puppet/vendor.rb:53:in `load_vendored'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/puppet-3.8.2/lib/puppet.rb:172:in `'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/puppet-3.8.2/lib/puppet.rb:29:in `'
        from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/puppet-3.8.2/lib/puppet/util/command_line.rb:12:in `'
        from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/puppet-3.8.2/bin/puppet:7:in `'
        from /usr/local/rvm/gems/ruby-2.2.1/bin/puppet:23:in `load'
        from /usr/local/rvm/gems/ruby-2.2.1/bin/puppet:23:in `
' from /usr/local/rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `eval' from /usr/local/rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `
'

This is very easy to fix by adding a require ‘syck’ to the puppet.rb file, and using gem to install this gem. The puppet.rb file is listed in the stack trace above, /usr/local/rvm/gems/ruby-2.2.1/gems/puppet-3.8.2/lib/puppet.rb (yours may differ).

I.e.:

require 'puppet/version'

# see the bottom of the file for further inclusions
# Also see the new Vendor support - towards the end
#
require 'facter'
require 'syck'
require 'puppet/error'
require 'puppet/util'
...

One thought on “Puppet 3.* not compatible with Ruby 2.2.*”

  1. I’ve encountered this problem with `puppet-3.8.5-1puppetlabs1` and `ruby-2.2.0-1bbox1~trusty1`
    Solved in two minutes installing `syck-1.0.5.gem` and pathing puppet-rb as you described. Thanks for sharing!

Leave a Reply

Your email address will not be published. Required fields are marked *