Facter on Amazon AMI with ruby2

60 views
Skip to first unread message

Peter Romfeld

unread,
Jul 16, 2014, 6:30:44 AM7/16/14
to puppet...@googlegroups.com
Hi,

I have problems to get facter running:

OS:
Amazon Linux AMI release 2014.03
Ruby:
ruby 2.0.0p451 (2014-02-24 revision 45167) [x86_64-linux]

I tried the amz provided facter package and also facter2.1 from
puppetlabs repo, with both I have the same problem:
/usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require':
cannot load such file -- facter/application (LoadError)
from
/usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/bin/facter:18:in `<main>'

On other machines I can just reinstall ruby and use 1.8, but on one
machine I have something else running that requires ruby2

Cheers,
Peter

Khalid Hosein

unread,
Jan 30, 2015, 6:32:48 PM1/30/15
to puppet...@googlegroups.com
Hello Peter,

For your specific problem, I'd recommend using rvm (https://rvm.io/) - you can have the other app use a specific version (or version family) of Ruby. Or I suppose you could have facter use Ruby 1.8.

--
For others that may have this issue with Amazon Linux, here's what I did:
Out of the box, Amazon Linux (VERSION="2014.09") has both ruby2.0 and ruby1.8 installed. I just switched the default version at an OS level to 1.8 (/etc/alternatives):
  # update-alternatives --config ruby

HTH!

_Khalid

Štěpán Cenek

unread,
Jan 31, 2015, 12:09:58 PM1/31/15
to puppet...@googlegroups.com
You need to rebuild Facter with Ruby 2.0 (and very probably other stuff like Hiera & Puppet and deps).
Reply all
Reply to author
Forward
0 new messages