无法安装任何 vagrant 插件

Can't install any vagrant plugin

我正在尝试安装 Vagrant 插件,但出现此错误:

➜  ~  vagrant plugin install vagrant-bindfs
Installing the 'vagrant-bindfs' 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:

An error occurred while installing nokogiri (1.6.6.2), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.6.2'` succeeds before bundling.
➜  ~

然后,我尝试安装 Nokogiri:

➜  ~ gem install nokogiri -v '1.6.6.2'%
Building native extensions.  This could take a while...
Successfully installed nokogiri-1.6.6.2
Parsing documentation for nokogiri-1.6.6.2
Done installing documentation for nokogiri after 2 seconds
1 gem installed
➜  ~

然后我尝试再次安装 vagrant 插件,它说同样的事情:

Make sure that `gem install nokogiri -v '1.6.6.2'` succeeds before bundling.

尝试安装任何 vagrant 插件时也会发生同样的情况。

我正在使用 Vagrant 1.6.3 OSX Yosemite。

我是不是做错了什么?

看看有同样问题的其他人,看来您需要为 Nokogiri 设置一个环境变量:

Vagrant cannot install nokogiri-dependent plugins

NOKOGIRI_USE_SYSTEM_LIBRARIES=1 

此外,您使用 Vagrant 1.6.3 的任何原因显然这个问题已在 1.7.2 及以上版本:

https://github.com/mitchellh/vagrant/issues/3769

考虑将 Vagrant 升级到最新版本。

即使在其他答案中使用了 env 变量建议后,我仍然在 Vagrant 1.6.3 中苦苦挣扎。

已将 Vagrant 升级到最新版本 (1.7.2),现在可以安装插件了。