Vagrant 1.6.3 nokogiri depended plugin installation quickfix

  06 Aug 2014


After installing a fresh downloaded Vagrant version 1.6.3 from http://www.vagrantup.com (ATTOW), then try to install vagrant plugin, vagrant-omnibus. It’s unlucky that the log said

    λ zdk ⮀ ~ 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.
    ************************************************************************
    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.3.1), and Bundler cannot continue.
    Make sure that `gem install nokogiri -v '1.6.3.1'` succeeds before bundling.

Digging further more into the related problem, found out that it seems to be nokogiri gem issue. But there is no proper fix yet at the moment. However, there are a few workarounds people are talking here: https://github.com/mitchellh/vagrant/issues/3769

For me, though, the most reasonable workaround is simply let Vagrant use its embedded version of nokogiri. So, add this line:

s.add_dependency(%q<nokogiri>, ["= 1.6.2.1"])

to the embedded vagrant gem spec, that is the file: /Applications/Vagrant/embedded/gems/specifications/vagrant-1.6.3.gemspec

And vagrant seems to be happy about this :)

λ zdk ⮀ hello vagrant plugin install vagrant-omnibus
Installing the 'vagrant-omnibus' plugin. This can take a few minutes...
Installed the plugin 'vagrant-omnibus (1.4.1)'!
comments powered by Disqus