So I wanted to make sure Puppet only supports Ruby 1.8 as I’d seen on a support mailing list. It turns out the main Puppet Supported Platforms page says Puppet 3.5.1 supports Ruby 2.1. Epic win! So I installed it:
First, I need to install the Ruby Version Manager (RVM):
[root@centos ~]# curl -L get.rvm.io | bash -s stable
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 20511 100 20511 0 0 15003 0 0:00:01 0:00:01 --:--:-- 770k
Downloading https://github.com/wayneeseguin/rvm/archive/stable.tar.gz
Creating group 'rvm'
Installing RVM to /usr/local/rvm/
cp: cannot stat `/usr/local/rvm/src/rvm/bin/rake': No such file or directory
cp: cannot stat `/usr/local/rvm/src/rvm/bin/bundle': No such file or directory
Installation of RVM in /usr/local/rvm/ is almost complete:
* First you need to add all users that will be using rvm to 'rvm' group,
and logout - login again, anyone using rvm will be operating with `umask u=rwx,g=rwx,o=rx`.
* To start using RVM you need to run `source /etc/profile.d/rvm.sh`
in all your open shell windows, in rare cases you need to reopen all shell windows.
# Administrator,
#
# Thank you for using RVM!
# We sincerely hope that RVM helps to make your life easier and more enjoyable!!!
#
# ~Wayne, Michal & team.
In case of problems: http://rvm.io/help and https://twitter.com/rvm_io
So far so good. Next, set it up:
[root@centos ~]# rvm reload
-bash: rvm: command not found
[root@centos ~]# source /etc/profile.d/rvm.sh
[root@centos ~]# rvm reload
RVM reloaded!
Okay. Next, install 2.1.0:
[root@centos ~]# rvm install 2.1.0
Searching for binary rubies, this might take some time.
Found remote file https://rvm.io/binaries/centos/6/x86_64/ruby-2.1.0.tar.bz2
Checking requirements for centos.
Installing requirements for centos.
Updating system..................
Installing required packages: libyaml-devel, libffi-devel, autoconf, gcc-c++, readline-devel, zlib-devel, openssl-devel, automake, libtool, bison.....................
Requirements installation successful.
ruby-2.1.0 - #configure
ruby-2.1.0 - #download
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 20.1M 100 20.1M 0 0 976k 0 0:00:21 0:00:21 --:--:-- 901k
ruby-2.1.0 - #validate archive
ruby-2.1.0 - #extract
ruby-2.1.0 - #validate binary
ruby-2.1.0 - #setup
ruby-2.1.0 - #making binaries executable..
ruby-2.1.0 - #downloading rubygems-2.2.2
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 404k 100 404k 0 0 830k 0 --:--:-- --:--:-- --:--:-- 1304k
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.1.0 - #extracting rubygems-2.2.2...
ruby-2.1.0 - #removing old rubygems.........
ruby-2.1.0 - #installing rubygems-2.2.2...............
ruby-2.1.0 - #gemset created /usr/local/rvm/gems/ruby-2.1.0@global
ruby-2.1.0 - #importing gemset /usr/local/rvm/gemsets/global.gems.............................................
ruby-2.1.0 - #generating global wrappers.........
ruby-2.1.0 - #gemset created /usr/local/rvm/gems/ruby-2.1.0
ruby-2.1.0 - #importing gemsetfile /usr/local/rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.1.0 - #generating default wrappers.........
Brilliant! Now, test to make sure Puppet 3.5.1 still works nicely:
[root@centos ~]# puppet help help help
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- json (LoadError)
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/lib/ruby/site_ruby/1.8/puppet/module.rb:3
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/lib/ruby/site_ruby/1.8/puppet/parser/files.rb:1
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/lib/ruby/site_ruby/1.8/puppet/parser/templatewrapper.rb:1
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/lib/ruby/site_ruby/1.8/puppet/parser/scope.rb:6
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/lib/ruby/site_ruby/1.8/puppet/parser/methods.rb:2
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/lib/ruby/site_ruby/1.8/puppet/parser/ast/method_call.rb:2
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/lib/ruby/site_ruby/1.8/puppet/parser/ast.rb:115
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/lib/ruby/site_ruby/1.8/puppet/parser/parser.rb:11
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/lib/ruby/site_ruby/1.8/puppet/parser.rb:4
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/lib/ruby/site_ruby/1.8/puppet.rb:249
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:12
from /usr/bin/puppet:3:in `require'
from /usr/bin/puppet:3
Uh oh! Not good. Perhaps JSON isn’t installed correctly?
[root@centos ~]# gem list json
*** LOCAL GEMS ***
fog-json (1.0.0)
json (1.8.1)
multi_json (1.9.2)
[root@centos ~]# gem update --system
Latest version currently installed. Aborting.
[root@centos ~]# gem install json
Fetching: json-1.8.1.gem (100%)
Building native extensions. This could take a while...
Successfully installed json-1.8.1
Parsing documentation for json-1.8.1
Installing ri documentation for json-1.8.1
Done installing documentation for json after 0 seconds
1 gem installed
Well it looked like it was installed, but it still installed it again. Anyway, let’s test Puppet again:
[root@centos ~]# puppet help help help
/usr/local/rvm/gems/ruby-2.1.0/gems/json-1.8.1/lib/json/ext/parser.so: [BUG] Segmentation fault
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
Aborted (core dumped)
[root@centos ~]# puppet --version
/usr/local/rvm/gems/ruby-2.1.0/gems/json-1.8.1/lib/json/ext/parser.so: [BUG] Segmentation fault
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
Aborted (core dumped)
Crud! Puppet is totally broken. I may have to go back to Ruby 1.8.7 after all…
0 Comments.