Puppet fails to run if ruby1.8 is not installed.

1,761 views
Skip to first unread message

Jason Price

unread,
Mar 29, 2014, 10:54:16 PM3/29/14
to puppet...@googlegroups.com
Amazon this week took ruby1.8 out of their Amazon Linux distro.

Only ruby2.0 is installed.

After installing the puppetlabs yum repo package, and then yum install puppet, I have this error:

# puppet agent -t
/usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- puppet/util/command_line (LoadError)
        from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /usr/bin/puppet:3:in `<main>'

If I install ruby18, I can get things working again, but puppet's web page says ruby 2.0 is perfectly supported.

I note that the puppetlabs puppet RPM installs a TON of stuff in /usr/lib/ruby/site_ruby/1.8 but there's no corresponding 'stuff' for 2.0.  Specifically, the 'command_line' bit certainly is only in the 1.8 path...

Any insights would be deeply appreciated.

(and yes, I could install 1.8, set alternatives to use 1.8, etc, but I'd rather not bother)

System details:

# rpm -qa | grep puppet
puppetlabs-release-6-10.noarch
puppet-3.4.3-1.el6.noarch

# rpm -qa | grep ruby
rubygems20-2.0.14-1.14.amzn1.noarch
ruby-shadow-1.4.1-15.5.amzn1.x86_64
libselinux-ruby-2.1.10-3.17.amzn1.x86_64
ruby20-libs-2.0.0.451-1.14.amzn1.x86_64
ruby-rgen-0.6.5-2.el6.noarch
rubygem20-psych-2.0.0-1.14.amzn1.x86_64
rubygem20-rdoc-4.0.1-2.18.amzn1.noarch
ruby-2.0-0.3.amzn1.noarch
rubygem20-bigdecimal-1.2.0-1.14.amzn1.x86_64
ruby-augeas-0.4.1-1.6.amzn1.x86_64
rubygem20-json-1.7.7-101.27.amzn1.x86_64
ruby20-irb-2.0.0.451-1.14.amzn1.noarch
ruby20-2.0.0.451-1.14.amzn1.x86_64
ruby18-libs-1.8.7.374-2.42.3.amzn1.x86_64
rubygem-json-2.0-0.3.amzn1.noarch

Jason Price

unread,
Mar 30, 2014, 6:03:02 PM3/30/14
to puppet...@googlegroups.com
ok.  So for anyone else digging for this issue:

Amazon Linux just did an update to be closer to what RHEL7 will look like, which means they dropped a default install of ruby 1.8.x

The Puppet RPM package is compiled against RHEL5/6 which has ruby 1.8.x.  So it drops a ton of its dependencies into /usr/lib/ruby/site_ruby/1.8.

If Ruby 1.8 isn't there, everything is broken.  Fix is to "yum install ruby18 ; alternatives --configure ruby" and set 1.8 as the default ruby.  Which is ugly.  Or build your own RPM.

--Jason (yuck)

Michael O'Dea

unread,
Mar 31, 2014, 3:01:57 PM3/31/14
to puppet...@googlegroups.com
I ran into the same issue this weekend, and discovered that the Amazon yum repo's latest Puppet package (2.7.25) has ruby1.8 "shebang'd".  With that puppet release, you can have ruby2.0 on the system as the default and still have puppet running correctly.  If your hosts are running the puppet agent as a service, and you haven't restarted them since the 2.0 release (last Thursday?), you can even upgrade puppet with a simple:

package { 'puppet': ensure => 'latest' }

YMMV, that worked with the 10 or so hosts I had that were still on puppet < 2.7.25.

--
M

Tom Poulton

unread,
Apr 4, 2014, 3:40:44 PM4/4/14
to puppet...@googlegroups.com
I was running into this problem as well so I ran:

sudo cp -r /usr/lib/ruby/site_ruby/1.8/* /usr/local/share/ruby/site_ruby/2.0/

/usr/local/share/ruby/site_ruby/2.0/ is part of the $LOAD_PATH so I figured why not stick the files in there and see what happens, now I can run puppet --version plus facter ipaddress etc. That's all I've run so far so there might be some weirdness down the line, but it's a start!?

It would be better if it was a symlink or something so you wouldn't have to run this again after a yum update, but hopefully puppetlabs will ralease a new RPM soon that works, I'm guessing they will now that AWS are running ruby 2.0.0 as default!?

Nick Cammorato

unread,
Apr 4, 2014, 3:50:59 PM4/4/14
to puppet...@googlegroups.com
Did anyone try using the EL7 RPM?  I've had success with testing with it in the RHEL7 beta, so if amazon has moved closer to RHEL7, it should be worth a shot.

--Nick


--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/ada194cd-89bb-49dd-841b-39c4f2cbf42b%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Charlie Sharpsteen

unread,
Apr 4, 2014, 10:24:57 PM4/4/14
to puppet...@googlegroups.com
The Puppet Labs EL 6 repos are designed to be compatible with RHEL 6.x and CentOS 6.x which will remain on Ruby 1.8.7 for the rest of their lifetimes. By upgrading the default Ruby to 2.0, Amazon Linux has broken compatibility with EL 6. Puppet Labs probably won't be able to compensate for this in the EL 6 repos due to the need to stay compatible with systems running 1.8.7.

Renaming the site_ruby directory may bring varying degrees of success, but the puppet package has at least two dependencies, ruby-augeas and ruby-shadow, that contain extensions that have been compiled against the Ruby 1.8.7 libraries. The only way to achieve compatibility in these cases is to re-build the packages against Ruby 2.0.0.

Michael G. Noll

unread,
Apr 23, 2014, 5:43:02 AM4/23/14
to puppet...@googlegroups.com


On Friday, April 4, 2014 9:50:59 PM UTC+2, Nick Cammorato wrote:
Did anyone try using the EL7 RPM?  I've had success with testing with it in the RHEL7 beta, so if amazon has moved closer to RHEL7, it should be worth a shot.

Using the EL7 RPM does not work on the 2014 Amazon Linux AMI.  The EL7 version of Puppet requires systemd, and the latter is not available on Amazon Linux.

$ sudo rpm -ivh https://yum.puppetlabs.com/el/7/products/x86_64/puppetlabs-release-7-10.noarch.rpm
$ sudo yum clean all
$ sudo yum install puppet facter
[...]
Error: Package: puppet-3.5.1-1.el7.noarch (puppetlabs-products)
           Requires: systemd
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
 

Best,
Michael

Reply all
Reply to author
Forward
0 new messages