voxpupuli / vagrant-librarian-puppet

A Vagrant plugin to install Puppet modules using Librarian-Puppet.
MIT License
99 stars 26 forks source link

'Unable to load puppet' error #59

Open ernestoe opened 7 years ago

ernestoe commented 7 years ago

After installing this plugin on MacOS, haven't been able to execute properly and getting the following error.

$vagrant provision db
==> db: Installing Puppet modules in "librarian" with Librarian-Puppet...
Unable to load puppet. Please install it using native packages for your platform (eg .deb, .rpm, .dmg, etc).
puppet --version returned pid 14665 exit 1
/opt/vagrant/embedded/lib/ruby/2.2.0/rubygems/dependency.rb:315:in `to_specs': Could not find 'puppet' (>= 0) among 44 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/opt/vagrant/embedded/gems', execute `gem env` for more information
    from /opt/vagrant/embedded/lib/ruby/2.2.0/rubygems/dependency.rb:324:in `to_spec'
    from /opt/vagrant/embedded/lib/ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:64:in `gem'
    from /Users/ernestoe/.vagrant.d/gems/2.2.5/bin/puppet:22:in `<main>'

My environment:

$vagrant --version
Vagrant 1.9.5
$vagrant plugin list
vagrant-librarian-puppet (0.9.2)
vagrant-share (1.1.8)
  - Version Constraint: > 0

Don't know if this is related to #47 and whether other setup could do the trick as this is my first install.

lzecca78 commented 7 years ago

Same issue with Ubuntu 16.04 , Vagrant 1.9.5 and Puppet 4.10. Going back to older Vagrant version (i tried with Vagrant 1.9.1) and installing puppet from package 3.8.5, is a workaround to make vagrant-librarian-puppet still working .

rbclark commented 7 years ago

I am currently working with no problem on 1.8.5, unfortunately I would prefer to run on a newer version of Vagrant if possible.

diLLec commented 7 years ago

Hi,

got the same issue on Windows 10 and vagrant 1.9.7. I think it is related to a change of vagrant, restricting the GEM_PATH to $VAGRANT_HOME/embedded/gems. If you add

ENV['GEM_PATH'] = '<your official gem path>#{::File::PATH_SEPARATOR}#{ENV['PATH']}"'

to vagrant-librarian-puppet/action/librarian_puppet.rb:24 the problem is gone. Another workaround would be to install the puppet gem into $VAGRANT_HOME/embedded/gems with

gem install puppet -v 4.10 --install-dir $VAGRANT_HOME/embedded/gems/

Greetings, Michael

fkoessler commented 7 years ago

Same issue with Ubuntu 14.04, Vagrant 1.9.6 and vagrant-librarian-puppet 0.9.2

==> default: Installing Puppet modules in "puppet" with Librarian-Puppet... Unable to load puppet. Please install it using native packages for your platform (eg .deb, .rpm, .dmg, etc). puppet --version returned pid 8200 exit 1 /opt/vagrant/embedded/lib/ruby/2.3.0/rubygems.rb:241:in 'bin_path': can't find gem puppet (>= 0.a) (Gem::GemNotFoundException) from /home/franz/.vagrant.d/gems/2.3.4/bin/puppet:22:in

' `

cdchase commented 6 years ago

FYI, I discovered the path I needed to specify for install-dir included the version # on end:

/opt/vagrant/embedded/gems/2.1.1

So, the full command was:

sudo gem install puppet --install-dir /opt/vagrant/embedded/gems/2.1.1/

Note, do not add gemson end as they will be installed too deep. :-)