Unable to install plugins that depend on nokogiri in Vagrant 1.6+
Since installing Vagrant 1.6.0, I'm unable to install landrush, or other plugins that depend on nokogiri:
I initially thought this was a landrush issue, but have reproduced with other vagrant plugins:
https://github.com/phinze/landrush/issues/69
I tested 1.6.1 and 1.6.2, both of which fail the same way. Reverting to 1.5.4 fixes the problem.
Could you share the logs? The underlying installer foundation didn't change at all between 1.5 and 1.6, which makes this odd.
Which logs shall I include? The landrush bug has a trace of the output. It's certainly strange, in that I'm sure it's been working fine for several days, but suddenly today our CI system and my own installation started to have the same issue. Entirely possible it's a bug elsewhere.
I have same error with "vagrant plugin update" command.
Error log:
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.2), and Bundler cannot continue.
Make sure that gem install nokogiri -v '1.6.2' succeeds before bundling.
Same issue here:
$ vagrant --version
Vagrant 1.6.2
$ vagrant plugin list
vagrant-login (1.0.1, system)
vagrant-share (1.0.1, system)
vagrant-vmware-fusion (2.4.1)
$ vagrant plugin update vagrant-vmware-fusion
Updating plugins: vagrant-vmware-fusion. This may take a few minutes...
Building nokogiri using packaged libraries.
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.2), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.2'` succeeds before bundling.
I run into this as well with vagrant 1.6.0, 1.6.1 and 1.6.2. Downgrading to 1.5.4 helps (but well..not really ;-))
$ vagrant plugin install vagrant-omnibus
Installing the 'vagrant-omnibus' plugin. This can take a few minutes...
Building nokogiri using packaged libraries.
Building libxml2-2.8.0 for nokogiri with the following patches applied:
- 0001-Fix-parser-local-buffers-size-problems.patch
- 0002-Fix-entities-local-buffers-size-problems.patch
- 0003-Fix-an-error-in-previous-commit.patch
- 0004-Fix-potential-out-of-bound-access.patch
- 0005-Detect-excessive-entities-expansion-upon-replacement.patch
- 0006-Do-not-fetch-external-parsed-entities.patch
- 0007-Enforce-XML_PARSER_EOF-state-handling-through-the-pa.patch
- 0008-Improve-handling-of-xmlStopParser.patch
- 0009-Fix-a-couple-of-return-without-value.patch
- 0010-Keep-non-significant-blanks-node-in-HTML-parser.patch
- 0011-Do-not-fetch-external-parameter-entities.patch
************************************************************************
IMPORTANT! Nokogiri builds and uses a packaged version of libxml2.
If this is a concern for you and you want to use the system library
instead, abort this installation process and reinstall nokogiri as
follows:
gem install nokogiri -- --use-system-libraries
If you are using Bundler, tell it to use the option:
bundle config build.nokogiri --use-system-libraries
bundle install
However, note that nokogiri does not necessarily support all versions
of libxml2.
For example, libxml2-2.9.0 and higher are currently known to be broken
and thus unsupported by nokogiri, due to compatibility problems and
XPath optimization bugs.
************************************************************************
Building libxslt-1.1.28 for nokogiri with the following patches applied:
- 0001-Adding-doc-update-related-to-1.1.28.patch
- 0002-Fix-a-couple-of-places-where-f-printf-parameters-wer.patch
- 0003-Initialize-pseudo-random-number-generator-with-curre.patch
- 0004-EXSLT-function-str-replace-is-broken-as-is.patch
- 0006-Fix-str-padding-to-work-with-UTF-8-strings.patch
- 0007-Separate-function-for-predicate-matching-in-patterns.patch
- 0008-Fix-direct-pattern-matching.patch
- 0009-Fix-certain-patterns-with-predicates.patch
- 0010-Fix-handling-of-UTF-8-strings-in-EXSLT-crypto-module.patch
- 0013-Memory-leak-in-xsltCompileIdKeyPattern-error-path.patch
- 0014-Fix-for-bug-436589.patch
- 0015-Fix-mkdir-for-mingw.patch
************************************************************************
IMPORTANT! Nokogiri builds and uses a packaged version of libxslt.
If this is a concern for you and you want to use the system library
instead, abort this installation process and reinstall nokogiri as
follows:
gem install nokogiri -- --use-system-libraries
If you are using Bundler, tell it to use the option:
bundle config build.nokogiri --use-system-libraries
bundle install
************************************************************************
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.2), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.2'` succeeds before bundling.
The same problem:
$ rm -rf ~/.vagrant.d
$ vagrant plugin update
Updating installed plugins...
Building nokogiri using packaged libraries.
Building libxml2-2.8.0 for nokogiri with the following patches applied:
- 0001-Fix-parser-local-buffers-size-problems.patch
- 0002-Fix-entities-local-buffers-size-problems.patch
- 0003-Fix-an-error-in-previous-commit.patch
- 0004-Fix-potential-out-of-bound-access.patch
- 0005-Detect-excessive-entities-expansion-upon-replacement.patch
- 0006-Do-not-fetch-external-parsed-entities.patch
- 0007-Enforce-XML_PARSER_EOF-state-handling-through-the-pa.patch
- 0008-Improve-handling-of-xmlStopParser.patch
- 0009-Fix-a-couple-of-return-without-value.patch
- 0010-Keep-non-significant-blanks-node-in-HTML-parser.patch
- 0011-Do-not-fetch-external-parameter-entities.patch
************************************************************************
IMPORTANT! Nokogiri builds and uses a packaged version of libxml2.
If this is a concern for you and you want to use the system library
instead, abort this installation process and reinstall nokogiri as
follows:
gem install nokogiri -- --use-system-libraries
If you are using Bundler, tell it to use the option:
bundle config build.nokogiri --use-system-libraries
bundle install
However, note that nokogiri does not necessarily support all versions
of libxml2.
For example, libxml2-2.9.0 and higher are currently known to be broken
and thus unsupported by nokogiri, due to compatibility problems and
XPath optimization bugs.
************************************************************************
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.2), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.2'` succeeds before bundling.
FYI: this might be caused by the recent upgrade of the nokogiri gem to 1.6.2 A quick workaround would be to pin the nokogiri gem version. Unfortunately I don't know where the gem is required/bundled by vagrant :-/
Quick fix: add s.add_dependency(%q<nokogiri>, ["< 1.6.2"]) to ~/Applications/Vagrant/embedded/gems/specifications/vagrant-1.6.2.gemspec
Installing nokogiri gem with system installed libxml2 is temporal solution for this issue.
- Install libxml2 to system.
- Run
export NOKOGIRI_USE_SYSTEM_LIBRARIES=true. - Then try
vagrant plugin update.
I've seen this happen when installing a pre-release version of vagrant-lxc and a user has just reported it as well.
Funny fact is that vagrant-lxc has no gem dependencies at all oO
Yep, I'm seeing this issue as well when attempting to install vmware_fusion /cc @josegonzalez
Confirmed that a downgrade works, though the export trick doesn't, and the s.add_dependency method doesn't work if you've deleted your .vagrant.d directory.
And now attempting to install vagrant-berkshelf in 1.5.4 also gives me the same error...
Ah, I wonder if this is caused by 1.6 adding the vagrant-windows dependencies which have a Nokogiri aspect.
/cc @sneal
I'm hitting this issue as well with vagrant-cachier, vagrant-omnibus, AND vagrant-hostsupdater
Downgrading to 1.5.4 doesn't work for me. After the downgrade when running vagrant plugin install vagrant-aws I still get the:
An error occurred while installing nokogiri (1.6.2), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.2'` succeeds before bundling.
Is there another version you guys downgraded to? Also how do you delete the current installation, by just deleting the /Applications/Vagrant directory and the /usr/bin/vagrant binary?
After downgrading to 1.5.4 all my plugin reinstalls were working, except berkshelf. It was giving me that nokogiri error. It ended up working fine when I explicitly declared the plugin version in the install command:
This:
$ vagrant plugin install vagrant-berkshelf --plugin-version '>=2.0.1'
Not this:
$ vagrant plugin install vagrant-berkshelf
Maybe that will help you with vagrant-aws… or maybe not.
I believe this is actually caused by a recent Nokogiri update. Our build servers have recently failed to even build the Vagrant installers anymore because of this issue. I'll attempt to find a workaround.
Same problem here on a fresh Debian 7.5 install with Vagrant 1.6.2, trying to install vagrant-lxc