"yum install puppet" vs "gem install puppet" on CentOS with Ruby 2.0. Gem works, not yum.

188 views
Skip to first unread message

Alexander Gray II

unread,
Apr 18, 2014, 3:13:39 PM4/18/14
to puppet...@googlegroups.com
Hey guys,

We have ruby 2.0.0 installed on a CentOS box.

I installed puppet via "yum install puppet":

[root@ip-10-165-39-216 ec2-user]# yum list installed | grep puppet
puppet.noarch                     3.5.1-1.el6                  @puppetlabs-products

But I get this error if I try to run puppet:

[ec2-user@ip-10-165-39-216 ~]$ puppet --version
/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>'

So for giggles, I did a "gem install puppet":

And puppet works:

[root@ip-10-165-39-216 ec2-user]# puppet --version
3.5.1

Why does "gem install puppet" work, but not "yum install puppet"?


Thanks!

Kenton Brede

unread,
Apr 18, 2014, 4:33:40 PM4/18/14
to puppet...@googlegroups.com
Puppet from the repo uses ruby 1.8.  Your ec2 instance is using ruby 2.0.

If you want to change which ruby version you're using on your ec2 servers, you can run:

alternatives --config ruby

If ruby 1.8 isn't installed on your system, you'll need to install it before you run the "alternatives" command. I probably didn't have to mention that though. :)

Kent


--
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/25d94a4e-4f6c-4a0d-9ea2-d868c6f1466f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Kent Brede




Reply all
Reply to author
Forward
0 new messages