Ask Your Question

puppet 4 - How do you install a gem into system ruby?

asked 2015-10-18 00:19:03 -0500

jbehrends gravatar image

I'm converting my environment to puppet 4.2 and noticed that I had failures because puppet is trying to install a gem into the AIO ruby that's included with puppet vs installing into my system ruby.

Log entry:

2015-10-17 17:37:19 -0700 Puppet (err): Execution of '/opt/puppetlabs/puppet/bin/gem install --no-rdoc --no-ri sensu-plugin' returned 2: ERROR:  Could not find a valid gem 'sensu-plugin' (>= 0), here is why:
          Unable to download data from - Errno::ECONNREFUSED: Connection refused - connect(2) for "" port 443 (

The failure is expected because this system can't access the internet and we have a local rubygems mirror that the system ruby gem is configured to use.

That being said, what do I need to do to get the puppet 4 agent (v1.2.4) to use the system ruby when installing a gem?


edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2015-10-20 18:30:02 -0500

jbehrends gravatar image

So in the time I posted this question, I found there is a bug with the init script shipped with the EL6 rpm of puppet-agent. The PATH is set with /opt/puppetlabs/puppet/bin which makes puppet use it's AIO gem instead of the system gem. I verified this isn't an issue on EL7..

Here is the ticket:

edit flag offensive delete link more

answered 2015-10-20 16:45:01 -0500

rnelson0 gravatar image

What does your code look like to install the gem? There are three gem providers for packages that I am aware of. gem, pe_gem, and pe_puppetserver_gem (the last two provided by modules) and you may have to specify the correct gem provider rather than rely on auto-detection of the correct provider to use.

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

1 follower


Asked: 2015-10-18 00:19:03 -0500

Seen: 264 times

Last updated: Oct 20 '15