Ask Your Question

Which Ruby version Puppet using?

asked 2013-09-11 04:36:05 -0600

dohoangkhiem gravatar image

updated 2013-09-11 04:41:57 -0600

Hi Puppet users, I need your help about Ruby version that will be used in Puppet agent node. I'm using the PuppetLabs VM PE-3.0.1 and as I inspected, there are a default Ruby in /usr/bin/ruby that just in 1.8.5 :(, while in /opt/puppet/bin there another embedded Ruby 1.9.3.

I'm developing a Puppet module that contains some new types & providers and I need some gems that should work in 1.8.7 or above. So currently, such resource declaration like package { 'nokogiri': ensure => installed, provider => 'gem' } or package { 'savon': ensure ... (more)

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2013-09-13 02:33:23 -0600

Stefan gravatar image

updated 2013-09-13 13:49:57 -0600

Can you please post the output of the following commands

$ facter rubysitedir rubyversion
$ which gem

If I got your question correctly you want to install a gem that you want to later use inside your ruby environment that runs puppet enterprise?

The gem package provider is intended to install packages that can be used on your system, e.g. because you distribute a ruby program with puppet, so it will install the gem with the gem systemcommand. If puppet enterprise comes with a different ruby envionment and with a different gem command but you need the gem inside your puppet ... (more)

edit flag offensive delete link more


Thank you so much Stefan, that's great, very detailed answer, so now my module works well with the custom feature that confine provider. Just the last and small question ...(more)

dohoangkhiem gravatar imagedohoangkhiem ( 2013-09-15 23:37:32 -0600 )edit

I don't use Puppet Enterprise myself but the pe_installer should ask you about installing symlinks in`/usr/local/bin` so if this directory is in PATH you should be ...(more)

Stefan gravatar imageStefan ( 2013-09-16 15:18:09 -0600 )edit

answered 2013-09-13 03:55:07 -0600

dohoangkhiem gravatar image

updated 2013-09-13 03:55:33 -0600

Hi Stefan, thanks for your answer. Here I add more information from the PE-3.0.1 VM

$ facter rubysitedir rubyversion rubysitedir => /opt/puppet/lib/ruby/site_ruby/1.9.1

rubyversion => 1.9.3

but I see another ruby in /usr/bin/ruby that just in 1.8.5, and by default, gem is not available from the /usr/bin so which gem return no result. So that makes me confuses about the default environment of Puppet agent node after bootstrapping, which Ruby is used (?), because 1.8.5 is relatively old and does not meet my requirements.

As about my ... (more)

edit flag offensive delete link more


I updated my answer to address your questions: 1) Install the dependencies on your agent with a package resource 2) confine your provider to a feature

Stefan gravatar imageStefan ( 2013-09-15 09:47:54 -0600 )edit

answered 2013-09-11 04:46:03 -0600

golja gravatar image

To get the list of supported ruby by puppet please have a look here

edit flag offensive delete link more


hi golja, thank for your answer, I know that page but I still curious that can I use the Ruby in /opt/puppet/bin to install required gem and execute ...(more)

dohoangkhiem gravatar imagedohoangkhiem ( 2013-09-11 04:57:04 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2013-09-11 04:36:05 -0600

Seen: 3,214 times

Last updated: Sep 13 '13