Ask Your Question
1

How do I install a gem for Puppet Enterprise using Bundler?

asked 2013-05-21 15:31:06 -0500

Ancillas gravatar image

updated 2013-05-21 15:32:37 -0500

I want to try out RC3 of r10k on Github. I usually use gem to install r10k, but now I think I need to use Bundler.

I installed bundler using /opt/puppet/bin/gem install bundler and then cloned the HEAD of r10k.

When I ran /opt/puppet/bin/bundle install --gemfile=./Gemfile, r10k installed within my cloned directory, but when I ran sudo r10k --help from the bin directory under the r10k directory, I get an error.

/usr/bin/env: ruby: No such file or directory

I'm guessing that it's not using the correct Ruby version. Do ... (more)

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
2

answered 2013-05-22 10:57:37 -0500

Ancillas gravatar image

updated 2013-06-06 14:54:25 -0500

I got it working this morning. This is probably obvious to most people, but I'll document my process anyway.

  1. Git clone the source of the gem that you want to install. For this example, I'll use r10k. git clone git://github.com/adrienthebo/r10k.git
  2. cd into the working directory. cd r10k
  3. Build the gem using the Puppet Enterprise version of gem. /opt/puppet/bin/gem build r10k.gemspec
  4. Install the gem that was just built using the Puppet Enterprise version of gem. sudo /opt/puppet/bin/gem install r10k-1.0.0rc3.gem
  5. Use the new gem. sudo ...
(more)
edit flag offensive delete link more

Comments

Since the question specifies "Bundler", I'll change the accepted answer if someone knows how to do this with bundler instead of building the gem.

Ancillas gravatar imageAncillas ( 2013-05-22 11:23:23 -0500 )edit
1

answered 2013-05-21 15:42:03 -0500

ramindk gravatar image

updated 2013-05-21 15:42:30 -0500

Chances are /usr/bin/env ruby is finding /usr/bin/ruby instead of /opt/puppet/bin/ruby. Try the following

sudo /opt/puppet/bin/ruby r10k --help

If that works, you might want to modify the r10k script or change local environmental settings or modify the local PATH so that /opt/puppet/bin takes precedence of /usr/bin.

edit flag offensive delete link more

Comments

There are several path dependencies in various .rb files that are failing after specifying /opt/puppet/bin/ruby. I think this is pure ignorance on my part as I took ...(more)

Ancillas gravatar imageAncillas ( 2013-05-22 10:53:09 -0500 )edit
1

Nice and I look forward to voting up your answer later today. :-)

ramindk gravatar imageramindk ( 2013-05-22 10:58:02 -0500 )edit
1

answered 2013-05-27 07:16:49 -0500

larstobi gravatar image

updated 2013-05-27 07:20:08 -0500

Another option, using only puppet, is to use the pe_gem module from puppetlabs.

Install the module: puppet module install puppetlabs/pe_gem

Then, specify to use the pe_gem provider, and apply it on the host:

package {
  'r10k':
    ensure   => '>=1.0.0rc4',
    provider => pe_gem;
}
edit flag offensive delete link more

Comments

Looks like I could have gotten away with `/opt/puppet/lib/gem install r10k --pre`, but you're absolutely right, the pe_gem module would be a better long-term approach.

Ancillas gravatar imageAncillas ( 2013-05-28 00:56:58 -0500 )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

2 followers

Stats

Asked: 2013-05-21 15:31:06 -0500

Seen: 1,482 times

Last updated: Jun 06 '13