Ask Your Question
3

Unable to run Puppet on OSX Mountain Lion [closed]

asked 2012-12-18 13:54:34 -0600

simonrondelez gravatar image

updated 2013-01-03 14:05:34 -0600

llowder gravatar image

I want to use Puppet in combination with Vagrant. I want to be able to install modules like iptables etc but I am unable to install anything.


So I have installed puppet (from a .dmg) ruby is installed on ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin12.2.0]


Everytime I try to run anything with puppet, I get the following:

/usr/bin/puppet:3:in `require': no such file to load -- puppet/util/command_line (LoadError)
from /usr/bin/puppet:3

What do I need to do to fix this?

image description

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by simonrondelez
close date 2013-01-03 15:27:17.185418

Comments

I think we might need a few more details. You say you get that error every time you want to anything with puppet, can you clarify the commands you're ...(more)

Celia gravatar imageCelia ( 2012-12-18 15:05:11 -0600 )edit

How did you install puppet?

stahnma gravatar imagestahnma ( 2012-12-18 15:21:28 -0600 )edit

One option is to use RVM (https://rvm.io/) to manage different Ruby environments and then create you own gemset where you can install Puppet and Vagrant as gems.

example42 gravatar imageexample42 ( 2012-12-19 03:30:05 -0600 )edit

@Celia if i want to run a .pp file, if i want to install an plugin,...

simonrondelez gravatar imagesimonrondelez ( 2012-12-21 12:25:52 -0600 )edit

4 Answers

Sort by » oldest newest most voted
7

answered 2012-12-26 21:28:40 -0600

Have you tried just installing puppet as a gem?

gem install puppet

It's always worked for me and I've never needed to screw around with symlinks.

edit flag offensive delete link more

Comments

make sure you've removed the puppet .dmg install first

rodjek gravatar imagerodjek ( 2012-12-28 10:22:54 -0600 )edit
1

You would want to remove /usr/lib/ruby/site_ruby/1.8/{puppet*,facter*,hiera*} to purge the system of the installed Puppetlabs dmg, and remove the puppet* binaries in /usr/bin

glarizza gravatar imageglarizza ( 2013-01-03 14:16:29 -0600 )edit

so this was the solution, i removed puppet completely with the dirs from @glarizza and than installed it with sudo gem install puppet

simonrondelez gravatar imagesimonrondelez ( 2013-01-03 15:25:31 -0600 )edit

Awesome! Using Puppet with the system version of Ruby should work perfectly fine with the Puppet Labs packages. If, however, you're using a non-standard version of Ruby, then I ...(more)

glarizza gravatar imageglarizza ( 2013-01-04 15:00:45 -0600 )edit

now i can continue with my thesis about Puppet and Chef!

simonrondelez gravatar imagesimonrondelez ( 2013-01-04 15:03:30 -0600 )edit
0

answered 2012-12-18 15:22:10 -0600

binford2k gravatar image

workaround

Until we have a better solution, you should create symlinks so that the library files may be imported properly.

sudo ln -s /usr/lib/ruby/site_ruby/1.8/puppet /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/site_ruby/1.8/puppet
sudo ln -s /usr/lib/ruby/site_ruby/1.8/puppet.rb /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/site_ruby/1.8/puppet.rb
sudo ln -s /usr/lib/ruby/site_ruby/1.8/semver.rb /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/site_ruby/1.8/semver.rb
edit flag offensive delete link more

Comments

puppet is located @ /usr/bin/puppet do these links fit?

simonrondelez gravatar imagesimonrondelez ( 2012-12-21 10:43:27 -0600 )edit

so i did what you siad but still i get the same error message:

simonrondelez gravatar imagesimonrondelez ( 2012-12-21 10:50:11 -0600 )edit

/usr/bin/puppet:3:in `require': no such file to load -- puppet/util/command_line (LoadError) from /usr/bin/puppet:3

simonrondelez gravatar imagesimonrondelez ( 2012-12-21 10:50:20 -0600 )edit

i must say that i had to make the folder site_ruby/1.8/

simonrondelez gravatar imagesimonrondelez ( 2012-12-21 10:50:58 -0600 )edit

@binford2k that doesn't do the job...

simonrondelez gravatar imagesimonrondelez ( 2012-12-25 15:08:19 -0600 )edit
-1

answered 2013-01-01 17:32:02 -0600

I am having the same problem. Installed from the packages provided by Puppet Labs. However using Ruby version 1.9.3.

› puppet resource user
/usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- puppet/util/command_line (LoadError)
    from /usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/bin/puppet:3:in `<main>'
edit flag offensive delete link more

Comments

The packages from Puppet Labs will ONLY install Puppet for the system ruby. If you've installed another Ruby, you will need to make it available to that Ruby - and ...(more)

glarizza gravatar imageglarizza ( 2013-01-03 14:08:16 -0600 )edit
-1

answered 2012-12-18 23:53:25 -0600

glarizza gravatar image

updated 2012-12-26 21:21:07 -0600

Those directories are actually symlinked to /Library/Ruby/Site/1.8. The installer should install to this location. How did you install Puppet? Where were Puppet's libraries being installed? Did you use the native package installer from http://downloads.puppetlabs.com/mac/?

Update:

I updated ticket 18205 ( https://projects.puppetlabs.com/issues/18205 ) in response to my findings. The following symlinks should exist on the system:

$ ls -la /usr/lib/ruby
lrwxr-xr-x  1 root  wheel  76 Oct 14 10:35 /usr/lib/ruby -> ../../System/Library/Frameworks/Ruby.framework/Versions/Current/usr/lib/ruby

$ls -la /usr/lib/ruby/site_ruby ...
(more)
edit flag offensive delete link more

Comments

i used the link that you posted ;)

simonrondelez gravatar imagesimonrondelez ( 2012-12-21 10:42:14 -0600 )edit

Question Tools

3 followers

Stats

Asked: 2012-12-18 13:54:34 -0600

Seen: 7,556 times

Last updated: Jan 03 '13