Rolling back Ruby to get Puppet to work again

Wow! It’s such an adventure. I may have to give the AWS stuff a skip and just use local machines. A friend has offered me an old laptop which I’m going to install CentOS on.

Now I wish to use Ruby 1.8.7 again as Puppet will (hopefully) be happy! A post on a support mailing list said RVM can be used to switch between multiple installed Rubys. Neat! Let’s give it a go:

[root@centos ~]# rvm use 1.8.7
ruby-1.8.7-p374 is not installed.
To install do: 'rvm install ruby-1.8.7-p374'

Hmm. I did have Ruby 1.8.7 installed before, but now it can’t be found! Okay, lets use RVM to install 1.8.7

[root@centos ~]# rvm install ruby-1.8.7-p374
Searching for binary rubies, this might take some time.
No binary rubies available for: centos/6/x86_64/ruby-1.8.7-p374.
It is not possible to build movable binaries for rubies 1.8-1.9.2, but you can do it for your system only.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for centos.
Requirements installation successful.
Installing Ruby from source to: /usr/local/rvm/rubies/ruby-1.8.7-p374, this may take a while depending on your cpu(s)...
ruby-1.8.7-p374 - #downloading ruby-1.8.7-p374, this may take a while depending on your connection...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 4150k  100 4150k    0     0   426k      0  0:00:09  0:00:09 --:--:--  888k
ruby-1.8.7-p374 - #extracting ruby-1.8.7-p374 to /usr/local/rvm/src/ruby-1.8.7-p374...
ruby-1.8.7-p374 - #applying patch /usr/local/rvm/patches/ruby/1.8.7/stdout-rouge-fix.patch.
ruby-1.8.7-p374 - #applying patch /usr/local/rvm/patches/ruby/1.8.7/no_sslv2.diff.
ruby-1.8.7-p374 - #applying patch /usr/local/rvm/patches/ruby/GH-488.patch.
ruby-1.8.7-p374 - #applying patch /usr/local/rvm/patches/ruby/ssl_no_ec2m.patch.
ruby-1.8.7-p374 - #configuring...............................
ruby-1.8.7-p374 - #post-configuration.
ruby-1.8.7-p374 - #compiling..........................................
ruby-1.8.7-p374 - #installing.
ruby-1.8.7-p374 - #making binaries executable..
ruby-1.8.7-p374 - #downloading rubygems-2.0.14
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  329k  100  329k    0     0   802k      0 --:--:-- --:--:-- --:--:-- 1243k
ruby-1.8.7-p374 - #extracting rubygems-2.0.14...
ruby-1.8.7-p374 - #removing old rubygems.........
ruby-1.8.7-p374 - #installing rubygems-2.0.14........................................
 
(several pages of dots later...)
 
ruby-1.8.7-p374 - #gemset created /usr/local/rvm/gems/ruby-1.8.7-p374@global
ruby-1.8.7-p374 - #importing gemset /usr/local/rvm/gemsets/ruby/1.8.7/global.gems...............................................................
ruby-1.8.7-p374 - #generating global wrappers.........
ruby-1.8.7-p374 - #gemset created /usr/local/rvm/gems/ruby-1.8.7-p374
ruby-1.8.7-p374 - #importing gemsetfile /usr/local/rvm/gemsets/default.gems evaluated to empty gem list
ruby-1.8.7-p374 - #generating default wrappers.........
ruby-1.8.7-p374 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-1.8.7-p374 - #complete
WARNING: Please be aware that you just installed a ruby that is no longer maintained (2014-02-23), for a list of maintained rubies visit:
 
    http://bugs.ruby-lang.org/projects/ruby/wiki/ReleaseEngineering
 
Please consider upgrading to ruby-2.1.1 which will have all of the latest security patches.
Ruby was built without documentation, to build it run: rvm docs generate-ri

Okay, let’s use it now:

[root@centos ~]# rvm use 1.8.7
Using /usr/local/rvm/gems/ruby-1.8.7-p374
[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)
(then a bunch of errors)

Not again! Well, looks like I need to reinstall json yet again:

[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
Installing ri documentation for json-1.8.1
/usr/local/rvm/rubies/ruby-1.8.7-p374/lib/ruby/1.8/rdoc/rdoc.rb:280: warning: conflicting chdir during another chdir block
/usr/local/rvm/rubies/ruby-1.8.7-p374/lib/ruby/1.8/rdoc/rdoc.rb:287: warning: conflicting chdir during another chdir block
Done installing documentation for json after 1 seconds
1 gem installed

RIGHT! Now, let’s test Puppet:

[root@centos ~]# puppet help help help
 
USAGE: puppet help <action>
 
Display Puppet help.
 
OPTIONS:
  --render-as FORMAT             - The rendering format to use.
  --verbose                      - Whether to log verbosely.
  --debug                        - Whether to log debug information.
 
ACTIONS:
  help    Display help about Puppet subcommands and their actions.
 
See 'puppet man help' or 'man puppet-help' for full help.

Aww, yiss! Looks good. We’ll give AWS a miss for now and perhaps visit it again in the future. I did post a link to my problems in this blog to the Puppet Users group. Hopefully something will come of that!

In the meantime, I hope this helps anyone with similar issues. At least mine is testing on my own VM which is not in production.



Leave a Comment

%d bloggers like this: