Vagrant with Librarian-Puppet Broken

2019-06-21 22:45发布

问题:

I'm having problems with provisioning new Vagrant instances. I've used the exact same configuration before without problems. I cannot figure out what's causing the problems when it used to work.

Vagrantfile

# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "precise64"
  config.vm.box_url = "http://files.vagrantup.com/precise64.box"

  config.vm.network :forwarded_port, guest: 80, host: 8080

  config.vm.provision :shell, :path => "puppet_prep.sh"

  config.vm.provision :puppet do |puppet|
    puppet.manifests_path = "puppet/manifests"
    puppet.manifest_file  = "init.pp"
  end
end

puppet_prep.sh This is from https://github.com/purple52/librarian-puppet-vagrant

#!/bin/sh

# Directory in which librarian-puppet should manage its modules directory
PUPPET_DIR=/etc/puppet/

# NB: librarian-puppet might need git installed. If it is not already installed
# in your basebox, this will manually install it at this point using apt or yum

$(which git > /dev/null 2>&1)
FOUND_GIT=$?
if [ "$FOUND_GIT" -ne '0' ]; then
  echo 'Attempting to install git.'
  $(which apt-get > /dev/null 2>&1)
  FOUND_APT=$?
  $(which yum > /dev/null 2>&1)
  FOUND_YUM=$?

  if [ "${FOUND_YUM}" -eq '0' ]; then
    yum -q -y makecache
    yum -q -y install git
    echo 'git installed.'
  elif [ "${FOUND_APT}" -eq '0' ]; then
    apt-get -q -y update
    apt-get -q -y install git
    echo 'git installed.'
  else
    echo 'No package installer available. You may need to install git manually.'
  fi
else
  echo 'git found.'
fi

if [ ! -d "$PUPPET_DIR" ]; then
  mkdir -p $PUPPET_DIR
fi
cp /vagrant/puppet/Puppetfile $PUPPET_DIR

if [ "$(gem search -i librarian-puppet)" = "false" ]; then
  gem install librarian-puppet
  cd $PUPPET_DIR && librarian-puppet install --clean
else
  cd $PUPPET_DIR && librarian-puppet update
fi

Result of vagrant up Command

Bringing machine 'default' up with 'virtualbox' provider...
[default] Importing base box 'precise64'...
[default] Matching MAC address for NAT networking...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] -- 80 => 8080 (adapter 1)
[default] Booting VM...
[default] Waiting for machine to boot. This may take a few minutes...
[default] Machine booted and ready!
[default] The guest additions on this VM do not match the installed version of
VirtualBox! In most cases this is fine, but in rare cases it can
prevent things such as shared folders from working properly. If you see
shared folder errors, please make sure the guest additions within the
virtual machine match the version of VirtualBox you have installed on
your host and reload your VM.

Guest Additions Version: 4.2.0
VirtualBox Version: 4.3
[default] Mounting shared folders...
[default] -- /vagrant
[default] -- /tmp/vagrant-puppet-1/manifests
[default] Running provisioner: shell...
[default] Running: /tmp/vagrant-shell20140615-27676-8xw1h9
stdin: is not a tty
Attempting to install git.
Ign http://us.archive.ubuntu.com precise InRelease
Ign http://us.archive.ubuntu.com precise-updates InRelease
Ign http://us.archive.ubuntu.com precise-backports InRelease
Hit http://us.archive.ubuntu.com precise Release.gpg
Get:1 http://us.archive.ubuntu.com precise-updates Release.gpg [198 B]
Get:2 http://us.archive.ubuntu.com precise-backports Release.gpg [198 B]
Hit http://us.archive.ubuntu.com precise Release
Ign http://security.ubuntu.com precise-security InRelease
Get:3 http://us.archive.ubuntu.com precise-updates Release [49.6 kB]
Get:4 http://security.ubuntu.com precise-security Release.gpg [198 B]
Get:5 http://us.archive.ubuntu.com precise-backports Release [49.6 kB]
Get:6 http://security.ubuntu.com precise-security Release [49.6 kB]
Hit http://us.archive.ubuntu.com precise/main Sources
Hit http://us.archive.ubuntu.com precise/restricted Sources
Hit http://us.archive.ubuntu.com precise/universe Sources
Hit http://us.archive.ubuntu.com precise/multiverse Sources
Hit http://us.archive.ubuntu.com precise/main amd64 Packages
Hit http://us.archive.ubuntu.com precise/restricted amd64 Packages
Hit http://us.archive.ubuntu.com precise/universe amd64 Packages
Hit http://us.archive.ubuntu.com precise/multiverse amd64 Packages
Hit http://us.archive.ubuntu.com precise/main i386 Packages
Hit http://us.archive.ubuntu.com precise/restricted i386 Packages
Hit http://us.archive.ubuntu.com precise/universe i386 Packages
Hit http://us.archive.ubuntu.com precise/multiverse i386 Packages
Hit http://us.archive.ubuntu.com precise/main TranslationIndex
Hit http://us.archive.ubuntu.com precise/multiverse TranslationIndex
Hit http://us.archive.ubuntu.com precise/restricted TranslationIndex
Hit http://us.archive.ubuntu.com precise/universe TranslationIndex
Get:7 http://us.archive.ubuntu.com precise-updates/main Sources [460 kB]
Get:8 http://security.ubuntu.com precise-security/main Sources [106 kB]
Get:9 http://us.archive.ubuntu.com precise-updates/restricted Sources [8,056 B]
Get:10 http://us.archive.ubuntu.com precise-updates/universe Sources [107 kB]
Get:11 http://us.archive.ubuntu.com precise-updates/multiverse Sources [8,909 B]
Get:12 http://us.archive.ubuntu.com precise-updates/main amd64 Packages [789 kB]
Get:13 http://security.ubuntu.com precise-security/restricted Sources [2,494 B]
Get:14 http://security.ubuntu.com precise-security/universe Sources [30.7 kB]
Get:15 http://security.ubuntu.com precise-security/multiverse Sources [1,795 B]
Get:16 http://security.ubuntu.com precise-security/main amd64 Packages [401 kB]
Get:17 http://security.ubuntu.com precise-security/restricted amd64 Packages [4,627 B]
Get:18 http://security.ubuntu.com precise-security/universe amd64 Packages [93.5 kB]
Get:19 http://security.ubuntu.com precise-security/multiverse amd64 Packages [2,434 B]
Get:20 http://security.ubuntu.com precise-security/main i386 Packages [427 kB]
Get:21 http://security.ubuntu.com precise-security/restricted i386 Packages [4,620 B]
Get:22 http://security.ubuntu.com precise-security/universe i386 Packages [98.7 kB]
Get:23 http://security.ubuntu.com precise-security/multiverse i386 Packages [2,647 B]
Get:24 http://security.ubuntu.com precise-security/main TranslationIndex [74 B]
Get:25 http://security.ubuntu.com precise-security/multiverse TranslationIndex [72 B]
Get:26 http://security.ubuntu.com precise-security/restricted TranslationIndex [72 B]
Get:27 http://security.ubuntu.com precise-security/universe TranslationIndex [73 B]
Get:28 http://security.ubuntu.com precise-security/main Translation-en [184 kB]
Get:29 http://us.archive.ubuntu.com precise-updates/restricted amd64 Packages [13.7 kB]
Get:30 http://us.archive.ubuntu.com precise-updates/universe amd64 Packages [241 kB]
Get:31 http://security.ubuntu.com precise-security/multiverse Translation-en [1,299 B]
Get:32 http://security.ubuntu.com precise-security/restricted Translation-en [1,253 B]
Get:33 http://security.ubuntu.com precise-security/universe Translation-en [57.5 kB]
Get:34 http://us.archive.ubuntu.com precise-updates/multiverse amd64 Packages [15.3 kB]
Get:35 http://us.archive.ubuntu.com precise-updates/main i386 Packages [822 kB]
Get:36 http://us.archive.ubuntu.com precise-updates/restricted i386 Packages [13.7 kB]
Get:37 http://us.archive.ubuntu.com precise-updates/universe i386 Packages [247 kB]
Get:38 http://us.archive.ubuntu.com precise-updates/multiverse i386 Packages [15.5 kB]
Get:39 http://us.archive.ubuntu.com precise-updates/main TranslationIndex [3,564 B]
Get:40 http://us.archive.ubuntu.com precise-updates/multiverse TranslationIndex [2,605 B]
Get:41 http://us.archive.ubuntu.com precise-updates/restricted TranslationIndex [2,461 B]
Get:42 http://us.archive.ubuntu.com precise-updates/universe TranslationIndex [2,850 B]
Get:43 http://us.archive.ubuntu.com precise-backports/main Sources [5,145 B]
Get:44 http://us.archive.ubuntu.com precise-backports/restricted Sources [14 B]
Get:45 http://us.archive.ubuntu.com precise-backports/universe Sources [38.4 kB]
Get:46 http://us.archive.ubuntu.com precise-backports/multiverse Sources [5,311 B]
Get:47 http://us.archive.ubuntu.com precise-backports/main amd64 Packages [6,412 B]
Get:48 http://us.archive.ubuntu.com precise-backports/restricted amd64 Packages [14 B]
Get:49 http://us.archive.ubuntu.com precise-backports/universe amd64 Packages [41.4 kB]
Get:50 http://us.archive.ubuntu.com precise-backports/multiverse amd64 Packages [5,206 B]
Get:51 http://us.archive.ubuntu.com precise-backports/main i386 Packages [6,420 B]
Get:52 http://us.archive.ubuntu.com precise-backports/restricted i386 Packages [14 B]
Get:53 http://us.archive.ubuntu.com precise-backports/universe i386 Packages [41.2 kB]
Get:54 http://us.archive.ubuntu.com precise-backports/multiverse i386 Packages [5,178 B]
Get:55 http://us.archive.ubuntu.com precise-backports/main TranslationIndex [72 B]
Get:56 http://us.archive.ubuntu.com precise-backports/multiverse TranslationIndex [72 B]
Get:57 http://us.archive.ubuntu.com precise-backports/restricted TranslationIndex [70 B]
Get:58 http://us.archive.ubuntu.com precise-backports/universe TranslationIndex [73 B]
Hit http://us.archive.ubuntu.com precise/main Translation-en
Hit http://us.archive.ubuntu.com precise/multiverse Translation-en
Hit http://us.archive.ubuntu.com precise/restricted Translation-en
Hit http://us.archive.ubuntu.com precise/universe Translation-en
Get:59 http://us.archive.ubuntu.com precise-updates/main Translation-en [352 kB]
Get:60 http://us.archive.ubuntu.com precise-updates/multiverse Translation-en [9,010 B]
Get:61 http://us.archive.ubuntu.com precise-updates/restricted Translation-en [3,027 B]
Get:62 http://us.archive.ubuntu.com precise-updates/universe Translation-en [140 kB]
Get:63 http://us.archive.ubuntu.com precise-backports/main Translation-en [5,882 B]
Get:64 http://us.archive.ubuntu.com precise-backports/multiverse Translation-en [4,610 B]
Hit http://us.archive.ubuntu.com precise-backports/restricted Translation-en
Get:65 http://us.archive.ubuntu.com precise-backports/universe Translation-en [32.9 kB]
Fetched 5,025 kB in 15s (327 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
  git-man liberror-perl patch
Suggested packages:
  git-daemon-run git-daemon-sysvinit git-doc git-el git-arch git-cvs git-svn
  git-email git-gui gitk gitweb diffutils-doc
The following NEW packages will be installed:
  git git-man liberror-perl patch
0 upgraded, 4 newly installed, 0 to remove and 160 not upgraded.
Need to get 6,821 kB of archives.
After this operation, 15.5 MB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ precise/main liberror-perl all 0.17-1 [23.8 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ precise/main git-man all 1:1.7.9.5-1 [630 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu/ precise/main git amd64 1:1.7.9.5-1 [6,087 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu/ precise/main patch amd64 2.6.1-3 [80.2 kB]
dpkg-preconfigure: unable to re-open stdin: No such file or directory
Fetched 6,821 kB in 25s (265 kB/s)
Selecting previously unselected package liberror-perl.
(Reading database ... 51095 files and directories currently installed.)
Unpacking liberror-perl (from .../liberror-perl_0.17-1_all.deb) ...
Selecting previously unselected package git-man.
Unpacking git-man (from .../git-man_1%3a1.7.9.5-1_all.deb) ...
Selecting previously unselected package git.
Unpacking git (from .../git_1%3a1.7.9.5-1_amd64.deb) ...
Selecting previously unselected package patch.
Unpacking patch (from .../patch_2.6.1-3_amd64.deb) ...
Processing triggers for man-db ...
Setting up liberror-perl (0.17-1) ...
Setting up git-man (1:1.7.9.5-1) ...
Setting up git (1:1.7.9.5-1) ...
Setting up patch (2.6.1-3) ...
git installed.
ERROR:  Error installing librarian-puppet:
    ERROR: Failed to build gem native extension.

        /opt/vagrant_ruby/bin/ruby extconf.rb
creating Makefile

make
sh: 1: make: not found


Gem files will remain installed in /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/json-1.8.1 for inspection.
Results logged to /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/json-1.8.1/ext/json/ext/generator/gem_make.out
Building native extensions.  This could take a while...
/tmp/vagrant-shell: 40: /tmp/vagrant-shell: librarian-puppet: not found
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

chmod +x /tmp/vagrant-shell && /tmp/vagrant-shell

Stdout from the command:

Attempting to install git.
Ign http://us.archive.ubuntu.com precise InRelease
Ign http://us.archive.ubuntu.com precise-updates InRelease
Ign http://us.archive.ubuntu.com precise-backports InRelease
Hit http://us.archive.ubuntu.com precise Release.gpg
Get:1 http://us.archive.ubuntu.com precise-updates Release.gpg [198 B]
Get:2 http://us.archive.ubuntu.com precise-backports Release.gpg [198 B]
Hit http://us.archive.ubuntu.com precise Release
Ign http://security.ubuntu.com precise-security InRelease
Get:3 http://us.archive.ubuntu.com precise-updates Release [49.6 kB]
Get:4 http://security.ubuntu.com precise-security Release.gpg [198 B]
Get:5 http://us.archive.ubuntu.com precise-backports Release [49.6 kB]
Get:6 http://security.ubuntu.com precise-security Release [49.6 kB]
Hit http://us.archive.ubuntu.com precise/main Sources
Hit http://us.archive.ubuntu.com precise/restricted Sources
Hit http://us.archive.ubuntu.com precise/universe Sources
Hit http://us.archive.ubuntu.com precise/multiverse Sources
Hit http://us.archive.ubuntu.com precise/main amd64 Packages
Hit http://us.archive.ubuntu.com precise/restricted amd64 Packages
Hit http://us.archive.ubuntu.com precise/universe amd64 Packages
Hit http://us.archive.ubuntu.com precise/multiverse amd64 Packages
Hit http://us.archive.ubuntu.com precise/main i386 Packages
Hit http://us.archive.ubuntu.com precise/restricted i386 Packages
Hit http://us.archive.ubuntu.com precise/universe i386 Packages
Hit http://us.archive.ubuntu.com precise/multiverse i386 Packages
Hit http://us.archive.ubuntu.com precise/main TranslationIndex
Hit http://us.archive.ubuntu.com precise/multiverse TranslationIndex
Hit http://us.archive.ubuntu.com precise/restricted TranslationIndex
Hit http://us.archive.ubuntu.com precise/universe TranslationIndex
Get:7 http://us.archive.ubuntu.com precise-updates/main Sources [460 kB]
Get:8 http://security.ubuntu.com precise-security/main Sources [106 kB]
Get:9 http://us.archive.ubuntu.com precise-updates/restricted Sources [8,056 B]
Get:10 http://us.archive.ubuntu.com precise-updates/universe Sources [107 kB]
Get:11 http://us.archive.ubuntu.com precise-updates/multiverse Sources [8,909 B]
Get:12 http://us.archive.ubuntu.com precise-updates/main amd64 Packages [789 kB]
Get:13 http://security.ubuntu.com precise-security/restricted Sources [2,494 B]
Get:14 http://security.ubuntu.com precise-security/universe Sources [30.7 kB]
Get:15 http://security.ubuntu.com precise-security/multiverse Sources [1,795 B]
Get:16 http://security.ubuntu.com precise-security/main amd64 Packages [401 kB]
Get:17 http://security.ubuntu.com precise-security/restricted amd64 Packages [4,627 B]
Get:18 http://security.ubuntu.com precise-security/universe amd64 Packages [93.5 kB]
Get:19 http://security.ubuntu.com precise-security/multiverse amd64 Packages [2,434 B]
Get:20 http://security.ubuntu.com precise-security/main i386 Packages [427 kB]
Get:21 http://security.ubuntu.com precise-security/restricted i386 Packages [4,620 B]
Get:22 http://security.ubuntu.com precise-security/universe i386 Packages [98.7 kB]
Get:23 http://security.ubuntu.com precise-security/multiverse i386 Packages [2,647 B]
Get:24 http://security.ubuntu.com precise-security/main TranslationIndex [74 B]
Get:25 http://security.ubuntu.com precise-security/multiverse TranslationIndex [72 B]
Get:26 http://security.ubuntu.com precise-security/restricted TranslationIndex [72 B]
Get:27 http://security.ubuntu.com precise-security/universe TranslationIndex [73 B]
Get:28 http://security.ubuntu.com precise-security/main Translation-en [184 kB]
Get:29 http://us.archive.ubuntu.com precise-updates/restricted amd64 Packages [13.7 kB]
Get:30 http://us.archive.ubuntu.com precise-updates/universe amd64 Packages [241 kB]
Get:31 http://security.ubuntu.com precise-security/multiverse Translation-en [1,299 B]
Get:32 http://security.ubuntu.com precise-security/restricted Translation-en [1,253 B]
Get:33 http://security.ubuntu.com precise-security/universe Translation-en [57.5 kB]
Get:34 http://us.archive.ubuntu.com precise-updates/multiverse amd64 Packages [15.3 kB]
Get:35 http://us.archive.ubuntu.com precise-updates/main i386 Packages [822 kB]
Get:36 http://us.archive.ubuntu.com precise-updates/restricted i386 Packages [13.7 kB]
Get:37 http://us.archive.ubuntu.com precise-updates/universe i386 Packages [247 kB]
Get:38 http://us.archive.ubuntu.com precise-updates/multiverse i386 Packages [15.5 kB]
Get:39 http://us.archive.ubuntu.com precise-updates/main TranslationIndex [3,564 B]
Get:40 http://us.archive.ubuntu.com precise-updates/multiverse TranslationIndex [2,605 B]
Get:41 http://us.archive.ubuntu.com precise-updates/restricted TranslationIndex [2,461 B]
Get:42 http://us.archive.ubuntu.com precise-updates/universe TranslationIndex [2,850 B]
Get:43 http://us.archive.ubuntu.com precise-backports/main Sources [5,145 B]
Get:44 http://us.archive.ubuntu.com precise-backports/restricted Sources [14 B]
Get:45 http://us.archive.ubuntu.com precise-backports/universe Sources [38.4 kB]
Get:46 http://us.archive.ubuntu.com precise-backports/multiverse Sources [5,311 B]
Get:47 http://us.archive.ubuntu.com precise-backports/main amd64 Packages [6,412 B]
Get:48 http://us.archive.ubuntu.com precise-backports/restricted amd64 Packages [14 B]
Get:49 http://us.archive.ubuntu.com precise-backports/universe amd64 Packages [41.4 kB]
Get:50 http://us.archive.ubuntu.com precise-backports/multiverse amd64 Packages [5,206 B]
Get:51 http://us.archive.ubuntu.com precise-backports/main i386 Packages [6,420 B]
Get:52 http://us.archive.ubuntu.com precise-backports/restricted i386 Packages [14 B]
Get:53 http://us.archive.ubuntu.com precise-backports/universe i386 Packages [41.2 kB]
Get:54 http://us.archive.ubuntu.com precise-backports/multiverse i386 Packages [5,178 B]
Get:55 http://us.archive.ubuntu.com precise-backports/main TranslationIndex [72 B]
Get:56 http://us.archive.ubuntu.com precise-backports/multiverse TranslationIndex [72 B]
Get:57 http://us.archive.ubuntu.com precise-backports/restricted TranslationIndex [70 B]
Get:58 http://us.archive.ubuntu.com precise-backports/universe TranslationIndex [73 B]
Hit http://us.archive.ubuntu.com precise/main Translation-en
Hit http://us.archive.ubuntu.com precise/multiverse Translation-en
Hit http://us.archive.ubuntu.com precise/restricted Translation-en
Hit http://us.archive.ubuntu.com precise/universe Translation-en
Get:59 http://us.archive.ubuntu.com precise-updates/main Translation-en [352 kB]
Get:60 http://us.archive.ubuntu.com precise-updates/multiverse Translation-en [9,010 B]
Get:61 http://us.archive.ubuntu.com precise-updates/restricted Translation-en [3,027 B]
Get:62 http://us.archive.ubuntu.com precise-updates/universe Translation-en [140 kB]
Get:63 http://us.archive.ubuntu.com precise-backports/main Translation-en [5,882 B]
Get:64 http://us.archive.ubuntu.com precise-backports/multiverse Translation-en [4,610 B]
Hit http://us.archive.ubuntu.com precise-backports/restricted Translation-en
Get:65 http://us.archive.ubuntu.com precise-backports/universe Translation-en [32.9 kB]
Fetched 5,025 kB in 15s (327 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
  git-man liberror-perl patch
Suggested packages:
  git-daemon-run git-daemon-sysvinit git-doc git-el git-arch git-cvs git-svn
  git-email git-gui gitk gitweb diffutils-doc
The following NEW packages will be installed:
  git git-man liberror-perl patch
0 upgraded, 4 newly installed, 0 to remove and 160 not upgraded.
Need to get 6,821 kB of archives.
After this operation, 15.5 MB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ precise/main liberror-perl all 0.17-1 [23.8 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ precise/main git-man all 1:1.7.9.5-1 [630 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu/ precise/main git amd64 1:1.7.9.5-1 [6,087 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu/ precise/main patch amd64 2.6.1-3 [80.2 kB]
Fetched 6,821 kB in 25s (265 kB/s)
Selecting previously unselected package liberror-perl.
(Reading database ... 51095 files and directories currently installed.)
Unpacking liberror-perl (from .../liberror-perl_0.17-1_all.deb) ...
Selecting previously unselected package git-man.
Unpacking git-man (from .../git-man_1%3a1.7.9.5-1_all.deb) ...
Selecting previously unselected package git.
Unpacking git (from .../git_1%3a1.7.9.5-1_amd64.deb) ...
Selecting previously unselected package patch.
Unpacking patch (from .../patch_2.6.1-3_amd64.deb) ...
Processing triggers for man-db ...
Setting up liberror-perl (0.17-1) ...
Setting up git-man (1:1.7.9.5-1) ...
Setting up git (1:1.7.9.5-1) ...
Setting up patch (2.6.1-3) ...
git installed.
Building native extensions.  This could take a while...


Stderr from the command:

stdin: is not a tty
dpkg-preconfigure: unable to re-open stdin: No such file or directory
ERROR:  Error installing librarian-puppet:
    ERROR: Failed to build gem native extension.

        /opt/vagrant_ruby/bin/ruby extconf.rb
creating Makefile

make
sh: 1: make: not found


Gem files will remain installed in /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/json-1.8.1 for inspection.
Results logged to /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/json-1.8.1/ext/json/ext/generator/gem_make.out
/tmp/vagrant-shell: 40: /tmp/vagrant-shell: librarian-puppet: not found

回答1:

The script is installing the latest version of the librarian-puppet gem. That gem has been very actively developed and dependencies have changed, and now one of the dependencies is a native gem that needs to be compiled.

You should always lock versions if you want the process to be repeatable, just change the line to something like

gem install librarian-puppet -v 1.0.0

FWIW I'm a maintainer of the librarian-puppet gem



回答2:

You are missing a package call build-essential. This install things like gcc, make etc.

To fix it make the following changes in your puppet_pre.sh

Change the following code block:

  if [ "${FOUND_YUM}" -eq '0' ]; then
    yum -q -y makecache
    yum -q -y install git
    echo 'git installed.'
  elif [ "${FOUND_APT}" -eq '0' ]; then
    apt-get -q -y update
    apt-get -q -y install git
    echo 'git installed.'
  else
    echo 'No package installer available. You may need to install git manually.'
  fi

To the following:

  if [ "${FOUND_YUM}" -eq '0' ]; then
    yum -q -y build-essential
    yum -q -y makecache
    yum -q -y install git
    echo 'git installed.'
  elif [ "${FOUND_APT}" -eq '0' ]; then
    apt-get -q -y update
    apt-get -q -y install build-essential
    apt-get -q -y install git
    echo 'git installed.'
  else
    echo 'No package installer available. You may need to install git manually.'
  fi


回答3:

You got make: not found so the library can't compile. Install make.