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

Failed to install plugin depending on the "nokogiri" gem #8738

Closed
legal90 opened this issue Jun 29, 2017 · 10 comments
Closed

Failed to install plugin depending on the "nokogiri" gem #8738

legal90 opened this issue Jun 29, 2017 · 10 comments

Comments

@legal90
Copy link
Contributor

legal90 commented Jun 29, 2017

Vagrant version

1.9.6

Host operating system

macOS Sierra 10.12.5

Description

That issue is related to #8593 and #8594.
hashicorp/vagrant-installers#104 was supposed to be a fix, but seems like it doesn't help.

$ vagrant plugin install vagrant-parallels
Installing the 'vagrant-parallels' plugin. This can take a few minutes...
Building native extensions.  This could take a while...
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:

ERROR: Failed to build gem native extension.

    current directory: /Users/legal/.vagrant.d/gems/2.3.4/gems/nokogiri-1.8.0/ext/nokogiri
/opt/vagrant/embedded/bin/ruby -r ./siteconf20170629-25808-pc7i18.rb extconf.rb
checking if the C compiler accepts ... yes
checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no
Building nokogiri using system libraries.
pkg-config could not be used to find libxml-2.0
Please install either `pkg-config` or the pkg-config gem per

    gem install pkg-config -v "~> 1.1.7"

pkg-config could not be used to find libxslt
Please install either `pkg-config` or the pkg-config gem per

    gem install pkg-config -v "~> 1.1.7"

pkg-config could not be used to find libexslt
Please install either `pkg-config` or the pkg-config gem per

    gem install pkg-config -v "~> 1.1.7"

ERROR: cannot discover where libxml2 is located on your system. please make sure `pkg-config` is installed.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/opt/vagrant/embedded/bin/$(RUBY_BASE_NAME)
	--help
	--clean
	--use-system-libraries=true
	--with-zlib-dir
	--without-zlib-dir
	--with-zlib-include
	--without-zlib-include=${zlib-dir}/include
	--with-zlib-lib
	--without-zlib-lib=${zlib-dir}/lib
	--with-xml2-dir
	--without-xml2-dir
	--with-xml2-include
	--without-xml2-include=${xml2-dir}/include
	--with-xml2-lib
	--without-xml2-lib=${xml2-dir}/lib
	--with-libxml-2.0-config
	--without-libxml-2.0-config
	--with-pkg-config
	--without-pkg-config
	--with-xslt-dir
	--without-xslt-dir
	--with-xslt-include
	--without-xslt-include=${xslt-dir}/include
	--with-xslt-lib
	--without-xslt-lib=${xslt-dir}/lib
	--with-libxslt-config
	--without-libxslt-config
	--with-exslt-dir
	--without-exslt-dir
	--with-exslt-include
	--without-exslt-include=${exslt-dir}/include
	--with-exslt-lib
	--without-exslt-lib=${exslt-dir}/lib
	--with-libexslt-config
	--without-libexslt-config

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Users/legal/.vagrant.d/gems/2.3.4/extensions/x86_64-darwin-13/2.3.0/nokogiri-1.8.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Users/legal/.vagrant.d/gems/2.3.4/gems/nokogiri-1.8.0 for inspection.
Results logged to /Users/legal/.vagrant.d/gems/2.3.4/extensions/x86_64-darwin-13/2.3.0/nokogiri-1.8.0/gem_make.out

The fragment of mkmf.log:

"pkg-config --exists libxml-2.0"
dyld: Symbol not found: _iconv
  Referenced from: /usr/lib/libcups.2.dylib
  Expected in: /opt/vagrant/embedded/lib/libiconv.2.dylib
 in /usr/lib/libcups.2.dylib
package configuration for libxml-2.0 is not found
"pkg-config --exists libxslt"
dyld: Symbol not found: _iconv
  Referenced from: /usr/lib/libcups.2.dylib
  Expected in: /opt/vagrant/embedded/lib/libiconv.2.dylib
 in /usr/lib/libcups.2.dylib
package configuration for libxslt is not found
"pkg-config --exists libexslt"
dyld: Symbol not found: _iconv
  Referenced from: /usr/lib/libcups.2.dylib
  Expected in: /opt/vagrant/embedded/lib/libiconv.2.dylib
 in /usr/lib/libcups.2.dylib
package configuration for libexslt is not found
"clang -E -I/opt/vagrant/embedded/include/ruby-2.3.0/x86_64-darwin13 -I/opt/vagrant/embedded/include/ruby-2.3.0/ruby/backward -I/opt/vagrant/embedded/include/ruby-2.3.0 -I.  -I/vagrant-substrate/staging/embedded/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -I/vagrant-substrate/staging/embedded/include -I/vagrant-substrate/cache/ruby-2.3.4/include -fno-common -pipe   conftest.c -o conftest.i"
conftest.c:3:10: fatal error: 'libxml/xmlversion.h' file not found
#include <libxml/xmlversion.h>
         ^
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <libxml/xmlversion.h>
/* end */

That issue was reproduced on a clean Vagrant installation, with ~/.vagrant.d purged.
Running with NOKOGIRI_USE_SYSTEM_LIBRARIES=true produces the same output.
xcode-select --install is installed, pkg-config executable is available.
Also, libxml/xmlversion.h is available in both of Vagrant sandbox dir and in the system:

$ find /usr -name 'xmlversion.h'
/usr/include/libxml2/libxml/xmlversion.h

$ find /opt/vagrant -name 'xmlversion.h'
/opt/vagrant/embedded/include/libxml2/libxml/xmlversion.h

Expected behavior

Plugin installed

Actual behavior

What actually happened?

Steps to reproduce

vagrant plugin install vagrant-parallels

References

@legal90
Copy link
Contributor Author

legal90 commented Jun 29, 2017

JFYI: The same plugin version is installing fine under Vagrant 1.9.5 with NOKOGIRI_USE_SYSTEM_LIBRARIES set:

$ NOKOGIRI_USE_SYSTEM_LIBRARIES=true vagrant plugin install vagrant-parallels
Installing the 'vagrant-parallels' plugin. This can take a few minutes...
Building native extensions.  This could take a while...
Fetching: vagrant-winrm-0.7.0.gem (100%)
Fetching: vagrant-parallels-1.7.5.gem (100%)
Installed the plugin 'vagrant-parallels (1.7.5)'!

@stephenreay
Copy link

stephenreay commented Jun 30, 2017

Also happening on El Capitan (10.11).

Note however that the NOKOGIRI_USE_SYSTEM_LIBRARIES trick doesn't fully work for me on 1.9.5 - I can install ok, but then I can't actually run vagrant.

@chrisroberts
Copy link
Member

Keeping this open until release is out with fix included

@legal90
Copy link
Contributor Author

legal90 commented Jul 6, 2017

@chrisroberts Could you please cut a new version or release a hotfix release of 1.9.6 with hashicorp/vagrant-installers#114 included?

It is really urgent for us since all the plugins depending on nokogiri gem are not compatible with Vagrant 1.9.6 at all 😢

@chrisroberts
Copy link
Member

@legal90 I have the fix integrated into the installers repo. Needed to address a couple other things before cutting the next release but will be doing so later today.

@legal90
Copy link
Contributor Author

legal90 commented Jul 6, 2017

@chrisroberts Thank you! 👍

@HarryWeppner
Copy link
Contributor

@chrisroberts do you have an update? We rely on a fix in 1.9.6 but this regression blocks using it :-/

@chrisroberts
Copy link
Member

@HarryWeppner Some things needed to be finalized before the next release. It is currently in progress and this issue will be closed once it is available.

@chrisroberts
Copy link
Member

Fixed in latest release.

@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.

@hashicorp hashicorp 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.
Projects
None yet
Development

No branches or pull requests

4 participants