vagrant
Installer un plugin Vagrant sur Mac OS X
29/12/14 21:06 Classé dans: Installations

L'installation de Vagrant est très aisée, il suffit de télécharger l'image DMG sur le site officiel et faire l'installation, pas de souci. Lorsque j'ai voulu installer le plugin vagrant-vbox-snapshot permettant la gestion de snapshot avec Virtual-box, les ennuis ont commencés. Voici la commande pour l'installation du plugin :
sudo vagrant plugin install vagrant-vbox-snapshot
Vous remarquerez que vous devez installer les plugins avec un compte administrateur. Vous obtiendrez le message suivant :
Installing the 'vagrant-vbox-snapshot' plugin. This can take a few minutes...
Malheureusement, au bout de quelques secondes, voici une partie des messages d'erreurs s'affichant sur mon écran :
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:
An error occurred while installing ffi (1.9.6), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.9.6'` succeeds before bundling.
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Applications/Vagrant/embedded/bin/ruby extconf.rb
checking for ffi.h... *** extconf.rb failed ***
Après de nombreuses recherches sur le net, voici la solution à ce problème : si vous êtes un grand développeur d'applications MAC OS X comme moi

sudo gcc
Après quelques pages de bla bla, validez en saisissant agree (indiqué en rouge) :
By typing 'agree' you are agreeing to the terms of the software license agreements. Type 'print' to print them or anything else to cancel, [agree, print, cancel] agree
You can view the license agreements in Xcode's About Box, or at /Applications/Xcode.app/Contents/Resources/English.lproj/License.rtf
clang: error: no input files
Vous pouvez, de nouveau, installer le plugin avec succès :
sudo vagrant plugin install vagrant-vbox-snapshot
Installing the 'vagrant-vbox-snapshot' plugin. This can take a few minutes...
Installed the plugin 'vagrant-vbox-snapshot (0.0.8)'!
Autre déconvenue, en réalisant des essais de suppression du plugin avec cette commande :
sudo vagrant plugin uninstall vagrant-vbox-snapshot
Uninstalling the 'vagrant-vbox-snapshot' plugin...
Lorsque j'ai voulu réinstaller ce même plugin, j'ai eu droit à ce message d'erreur :
vagrant plugin install vagrant-vbox-snapshot
Installing the 'vagrant-vbox-snapshot' plugin. This can take a few minutes...
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:
Net::HTTPNotFound: No gems found matching "vagrant-vmware-workstation" "3.0.1" nil
Voici une autre astuce pour corriger ce problème, lancez cette commande :
sudo vagrant plugin update
Updating installed plugins...
All plugins are up to date.
Et j'ai pu réinstaller le plugin sans souci.