Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install plugins that depend on nokogiri in Vagrant 1.6+ #3769

Closed
lox opened this issue May 13, 2014 · 171 comments
Closed

Unable to install plugins that depend on nokogiri in Vagrant 1.6+ #3769

lox opened this issue May 13, 2014 · 171 comments
Labels

Comments

@lox
Copy link

lox commented May 13, 2014

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:

vagrant-landrush/landrush#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.

@mitchellh
Copy link
Contributor

Could you share the logs? The underlying installer foundation didn't change at all between 1.5 and 1.6, which makes this odd.

@lox
Copy link
Author

lox commented May 13, 2014

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.

@AlexeyPopov
Copy link

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.

@jonbuffington
Copy link

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.

@arosenhagen
Copy link

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.

@robsonpeixoto
Copy link

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.

@arosenhagen
Copy link

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 :-/

@arosenhagen
Copy link

Quick fix: add s.add_dependency(%q<nokogiri>, ["< 1.6.2"]) to ~/Applications/Vagrant/embedded/gems/specifications/vagrant-1.6.2.gemspec

@MisumiRize
Copy link

Installing nokogiri gem with system installed libxml2 is temporal solution for this issue.

  1. Install libxml2 to system.
  2. Run export NOKOGIRI_USE_SYSTEM_LIBRARIES=true.
  3. Then try vagrant plugin update.

@fgrehm
Copy link
Contributor

fgrehm commented May 13, 2014

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

@clarkbk
Copy link

clarkbk commented May 13, 2014

Yep, I'm seeing this issue as well when attempting to install vmware_fusion /cc @josegonzalez

@clarkbk
Copy link

clarkbk commented May 13, 2014

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.

@clarkbk
Copy link

clarkbk commented May 13, 2014

And now attempting to install vagrant-berkshelf in 1.5.4 also gives me the same error...

@mitchellh
Copy link
Contributor

Ah, I wonder if this is caused by 1.6 adding the vagrant-windows dependencies which have a Nokogiri aspect.

@mitchellh
Copy link
Contributor

/cc @sneal

@mitchellh mitchellh added the bug label May 13, 2014
@drpebcak
Copy link

I'm hitting this issue as well with vagrant-cachier, vagrant-omnibus, AND vagrant-hostsupdater

@gerritgg
Copy link

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?

@clarkbk
Copy link

clarkbk commented May 13, 2014

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.

@mitchellh
Copy link
Contributor

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.

@nodje
Copy link

nodje commented May 14, 2014

Same problem here on a fresh Debian 7.5 install with Vagrant 1.6.2, trying to install vagrant-lxc

@yveslaroche
Copy link

It works now on my machine with the last Nokogiri update v1.6.2.1.

1.6.2.1 / 2014-05-13

Bug fixes

Fix statically-linked libxml2 installation when using universal builds of Ruby. sparklemotion/nokogiri#1104

Patching mini_portile to address the git dependency detailed in sparklemotion/nokogiri#1102

Library load fix to address segfault reported on some systems. sparklemotion/nokogiri#1097

@ncloward
Copy link

👍

@mitchellh
Copy link
Contributor

Fixed for me too. I think this was a Nokogiri bug.

@clarkbk
Copy link

clarkbk commented May 14, 2014

Another 👍

@tomav
Copy link

tomav commented Mar 3, 2015

Same here, upgrading to 1.7.2 fixed the problem. Thank you @benjohnson77 & @obfuscurity

@arnlaugsson
Copy link

Updating to Vagrant 1.7.2 fixed it for me too.

~  ᐅ vagrant version
Installed Version: 1.7.2
Latest Version: 1.7.2

You're running an up-to-date version of Vagrant!
~  ᐅ vagrant plugin install vagrant-cachier
Installing the 'vagrant-cachier' plugin. This can take a few minutes...
Installed the plugin 'vagrant-cachier (1.2.0)'!

@hadifarnoud
Copy link

i still have this issue with vagrant 1.6.3 OSX 10.10.3 gem 2.4.6

I have tried ALL the above solutions. At last I edited nokogiri 1.6.2.1 gemspec in /Vagrant folder and modified the version to s.version = "1.6.6.2"

not sure this is going to mess up some things or not.

@fireproofsocks
Copy link

Having this problem with Vagrant 1.6.3 on Mac OS X 10.9.5, updating to Vagrant 1.7.2 fixed it.

@johnleetran
Copy link

upgrade to a newer version of vagrant OR

gem install --install-dir ~/.vagrant.d/gems nokogiri -v '1.6.3.1'

if you get another error like before run the same command on that package, for example

gem install --install-dir ~/.vagrant.d/gems dep_selector -v '1.0.3'

@jokeyrhyme
Copy link

I've had a great run with Vagrant, but I'm transitioning my projects to Docker now. Docker gets easier and easier to use each day, and it doesn't have any of the Ruby-to-C++ interface problems that Vagrant has. If you are having problems with Vagrant, give Docker a try.

@afilp
Copy link

afilp commented May 14, 2015

@jokeyrhyme Is there a "VVV" equivalent in Docker?

@jokeyrhyme
Copy link

@af7 if you mean http://varyingvagrantvagrants.org/ , then I'm not sure. I did find this (but it seems incomplete): https://github.com/Varying-Vagrant-Vagrants/vvv-docker/tree/lkwdwrd

@johnleetran
Copy link

i still prefer vagrant because vagrant boxes are easier to destroy than docker containers/images. i am tired of doing a

docker rmi -f $(docker images -q)
docker rm -f $(docker ps -aq)

Boot2docker, pushing to a privately hosted docker repository is a pain in the butt.

Another pain point, docker caching for building new docker images is a subtle trap. We've been bitten by this several times in development.

@theninthnode
Copy link

Solution for me with Vagrant 1.6.3 on Mac was adding this to vagrant-1.6.3.gemspec like suggested above:

s.add_dependency(%q, ["< 1.6.3"])

lukewertz added a commit to palantirnet/drupal-skeleton that referenced this issue Jun 23, 2015
A number of folks running older versions of vagrant experienced issues
getting nokogiri installed due to a bug that was fixed in vagrant
version 1.7.2: hashicorp/vagrant#3769

We shouldn't support older versions of Vagrant due to these issues.
@ryanotella
Copy link

I just had this error on vagrant 1.6.3 for nokogiri 1.6.6.2 when installing vagrant-cachier. But installing that version of nokogiri into ~/.vagrant.d/gems as per @johnleetran's suggestion solved it.

@damienalexandre
Copy link

On Ubuntu 15.10, I just had to install zlib1g-dev:

$ sudo apt install zlib1g-dev
$ vagrant plugin install vagrant-cachier
    Installing the 'vagrant-cachier' plugin. This can take a few minutes...
    Installed the plugin 'vagrant-cachier (1.2.1)'!

This is cleaner than installing an old version of nokogiri manually 😉

@Tyrael
Copy link

Tyrael commented Jan 12, 2016

not everybody was having problem of building nokogiri because of the missing zlib1g-dev package ;)

@Donal-Flanagan
Copy link

I had the exact same issue on ubuntu 15.10, with vagrant 1.7.4. Installing the zlib1g-dev package worked perfectly. Thanks for the fix @damienalexandre

@tartley
Copy link

tartley commented Mar 21, 2016

I also had the exact same issue on Ubuntu 15.10, with vagrant 1.7.4+dfsg-1_all (Ubuntu apt-get default version), but unlike @Donal-Flanagan, installing zlib1g-dev did not fix it for me. I then did a gem install nokogiri -v '1.6.7.2' (following the instructions in the error message Make sure that "gem install nokogiri -v '1.6.7.2'" succeeds...) and it did succeed, and after that, my vagrant plugin install... started working.

@Mathyn
Copy link

Mathyn commented Apr 13, 2016

I had this issue today when trying to install the vagrant-triggers plugin with Ubuntu 14.04. When I tried to manually run gem install nokogiri -v '1.6.7.2' as suggested by the error output this also failed to install but did provide the helpful error message zlib is missing; necessary for building libxml2.

After installing zlib (sudo apt-get install zlib1g-dev) I could install nokogiri and with that install vagrant-triggers.

@avishnyakov
Copy link

Getting this while using vagrant-azure (https://github.com/Azure/vagrant-azure) on win10. Not sure what the resolution might be yet.

@gnufred
Copy link

gnufred commented Jun 14, 2016

I had the same problem on Ubuntu 16.04. Installing the latest version of Vagrant from their website fixed it for me.

@bhouston
Copy link

@Mathyn thanks for the suggestion:

After installing zlib (sudo apt-get install zlib1g-dev) I could install nokogiri and with that install vagrant-triggers.

On a fresh install of Ubuntu 16.04, running sudo apt-get install zlib1g-dev got lxc running for me. Sweet.

@andela-mallan
Copy link

Quick fix!
I run VAGRANT_DISABLE_STRICT_DEPENDENCY_ENFORCEMENT=1 vagrant plugin install vagrant-<name_of_plugin> and worked for me as a temporary solution.
Let me know if it helps.

@ghost
Copy link

ghost commented Apr 1, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests