"Could not find RubyGem puppet" in "Tramp"

I can run bundle install manually and return something sensible, but when I let Puppet create a Vagrant field, this happens a second time (the first I get a successful output).

 [default] Running provisioner: Vagrant::Provisioners::Puppet... [default] Running Puppet with /tmp/vagrant-puppet/manifests/default.pp... stdin: is not a tty /opt/vagrant_ruby/lib/ruby/site_ruby/1.8/rubygems.rb:900:in `report_activate_error': Could not find RubyGem puppet (>= 0) (Gem::LoadError) from /opt/vagrant_ruby/lib/ruby/site_ruby/1.8/rubygems.rb:248:in `activate' from /opt/vagrant_ruby/lib/ruby/site_ruby/1.8/rubygems.rb:1276:in `gem' from /opt/vagrant_ruby/bin/puppet:18 The following SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed! 

I don’t require a doll stone anywhere, it’s not in my Gemfile, and my manifest does not require it either. Why are they looking for a puppet, and how can I get rid of this error?

+4
source share
3 answers

You run Puppet in a virtual machine. Make sure the gem is still installed for roaming and root users. It could be your default ruby ​​version switch (is the vs system installed via rvm or rbenv?).

Hope this helps.

+2
source

I use https://github.com/blt04/puppet-rvm to provide my Vagrant box RVM and I get the same problem. The fix "default_use => true" really fixes it. Unfortunately, you have to manually select your target Ruby as soon as you ssh'd into the field.

Alternatively, you can add the doll-doll in explicit form by default in Ruby in your manifest (and not in any gemset, only for Ruby itself). It still continued to listen to me with some kind of configuration file for hiera (??), but it worked anyway.

I wonder if RVM on a stroller is even worth the hassle. The whole point of creating a box for strollers is to have an isolated environment for one project, so why do I need several Rubies / Gemset?

+3
source

It is expected that Puppet will be launched by a tramp with a ruby ​​system, but RVM can by default use the ruby ​​of your choice. To get around this, I did this (rather ugly hack), still having a default ruby ​​when registering in normal mode:

In your stray file:

  # setup working dir only to exploit in below working_dir = '/home/vagrant/puppet' config.vm.provision :shell, :inline => "mkdir -p #{working_dir}" config.vm.provision "puppet" do |puppet| # [ ... Your config ... ] # before puppet is run, vagrand `cd`s into the working directory, failing to escape it. puppet.working_directory = "#{working_dir}; rvm use system || true" end 

Due to a bug / feature in the vagrant puppet provider ( https://github.com/mitchellh/vagrant/blob/master/plugins/provisioners/puppet/provisioner/puppet.rb#L154 ) this causes the vagabond

  • Start with rvm loaded and configured by default
  • Change to the specified directory
  • Switch to the ruby ​​system to find the gem again.
  • Launch the puppet, as at the first launch, without the intervention of RVM rubies.
0
source

All Articles