Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

The "libxml2" package isn't available #539

Closed
svendewindt opened this issue Apr 17, 2018 · 33 comments · May be fixed by #542
Closed

The "libxml2" package isn't available #539

svendewindt opened this issue Apr 17, 2018 · 33 comments · May be fixed by #542

Comments

@svendewindt
Copy link

svendewindt commented Apr 17, 2018

Hi,
When trying trying to install vagrant-aws pluging, the installation fails on this:
extconf.rb:29:in `

': The "libxml2" package isn't available. (RuntimeError)

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

C:/Users/Sven/.vagrant.d/gems/2.4.3/extensions/x64-mingw32/2.4.0/ovirt-engine-sdk-4.2.4/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in C:/Users/Sven/.vagrant.d/gems/2.4.3/gems/ovirt-engine-sdk-4.2.4 for inspection.
Results logged to C:/Users/Sven/.vagrant.d/gems/2.4.3/extensions/x64-mingw32/2.4.0/ovirt-engine-sdk-4.2.4/gem_make.out

The log file:
`find_executable: checking for xml2-config... -------------------- no

"pkg-config --exists libxml2"`
package configuration for libxml2 is not found

I've tried downloading libxml2 and adding it to the path, without succes. What can i do to resolve this?

This is on Windows 10.

Kind regards,
Sven.

@hegawa
Copy link

hegawa commented Apr 18, 2018

experiencing the same issue

@davekennewell
Copy link

+1. On windows 10 with Vagrant 2.0.4

@cre8tions
Copy link

cre8tions commented Apr 23, 2018

+1 Win10 Vagrant 2.0.4, reinstalled and tried vagrant plugin expunge --reinstall, no luck

Tried cinst libxslt libiconv -y -Source "https://go.microsoft.com/fwlink/?LinkID=230477" to install libxml, added the install path to $env:PATH as well

@cre8tions
Copy link

cre8tions commented Apr 23, 2018

I ran $env:Path="C:\HashiCorp\Vagrant\embedded\mingw64\bin;$env:Path" and tried to install again, it seems it's a Windows10 permissions error...

λ  vagrant plugin install vagrant-aws
Installing the 'vagrant-aws' plugin. This can take a few minutes...
C:/HashiCorp/Vagrant/embedded/mingw64/lib/ruby/2.4.0/rubygems/package.rb:383:in `initialize': Permission denied @ rb_sysopen - C:/Users/<user>/.vagrant.d/gems/2.4.3/gems/ovirt-engine-sdk-4.2.4/ext/ovirtsdk4c/extconf.rb (Errno::EACCES)

the ovirtsdk4c path had no owner, fixed that, ran vagrant plugin expunge --reinstall and and it installed fine

@ousamabenyounes
Copy link

+1. On windows 10 with Vagrant 2.0.3

tryed vagrant plugin expunge --reinstall
didn't fix the issue for me.

@marlowp
Copy link

marlowp commented Apr 24, 2018

+1. On Windows 10 with Vagrant 2.0.1.

@ChrisLeNeve
Copy link

Had this issue with Windows 10, Vagrant 2.0.3. Fixed it by installing Ruby separately (from https://rubyinstaller.org/downloads/) and RENAMING the ruby.exe and rubyw.exe files under C:\hashicorp\vagrant\embedded\mingw64\bin so Vagrant fell back on the new Ruby version. Guess the Ruby version that comes with Vagrant is lite and doesn't come with libxml2 package

@judcole
Copy link

judcole commented Apr 25, 2018

There are various issues with the latest packages for the AWS plugin running on Windows, but I am now up and running by doing the following, all of which are workarounds and will need to be changed for your install drives but show the cause of the problem:

  1. Copy C:\HashiCorp\Vagrant\embedded\mingw64\lib\pkgconfig\libxml-2.0.pc libxml2.pc

This allows the libxml2 package definition to be found (the definition was renamed to libxml-2.0 at some point).

  1. Create an empty "C:\HashiCorp\Vagrant\embedded\mingw64\x86_64-w64-mingw32\include\sys\select.h"

%VAGRANT_HOME%\gems\2.4.4\gems\ovirt-engine-sdk-4.2.4\ext\ovirtsdk4c\ov_http_client.c attempts to include it but it is not currently installed with the embedded mingw64.

  1. Move the #define _GETTIMEOFDAY_DEFINED line to before #ifndef _GETTIMEOFDAY_DEFINED in C:\HashiCorp\Vagrant\embedded\mingw64\x86_64-w64-mingw32\include\sys\time.h to prevent the new definition from being parsed.

There is a non-matching redefinition of gettimeofday as indicated by the compiler

  1. Remove the extra 'io' mapping at the end of %VAGRANT_HOME%\gems\2.4.4\gems\virtualbox-0.8.6\lib\virtualbox\com\ffi\util.rb

Unneeded duplicate mapping.

I hope that helps!

@planesweep
Copy link

planesweep commented May 21, 2018

Hi,
the bug/issue still exists for vagrant 2.1.1 :-(
On Windows, both solutions from JudeCole & ChrisLeNeve didn't work.
I am not able to install the vagrant-aws plugin !!!

@GaryGen
Copy link

GaryGen commented May 21, 2018

I was also having an issue with vagrant 2.1.1 on Windows 64-bit.
@judcole 's solution worked for me, but I was confused by step 3 at first.
The code change for moving the _GETTIMEOFDAY_DEFINED definition is to move ONLY the _GETTIMEOFDAY_DEFINED line, not the entire definition:

#define _GETTIMEOFDAY_DEFINED

#ifndef _GETTIMEOFDAY_DEFINED
#define _GETTIMEOFDAY_DEFINED
int __cdecl gettimeofday(struct timeval *__restrict__,
                         void *__restrict__  /* tzp (unused) */);
#endif

Also, virtual drive V was not defined for me, so I could not determine how to perform step 4, but that did not appear to affect the outcome.

@judcole
Copy link

judcole commented May 23, 2018

Sorry for the confusion on my step 4 above! To explain further:

  1. This fix is actually for an irritating but harmless warning thrown up by the vagrant-virtualbox plugin about a duplicate 'io' case value (Unneeded duplicate mapping).

  2. V:\vagrant is the folder where my .vagrant.d folder was installed, but in posting the full path a backslash got lost. It would have been clearer as %VAGRANT_HOME%\gems\2.4.4\gems\virtualbox-0.8.6\lib\virtualbox\com\ffi\util.rb

I have updated my comment to include the environment variable.

HTH

@savishy
Copy link

savishy commented May 25, 2018

My "solution" for this highly frustrating problem was

  1. Create an Ubuntu Vagrant box on Windows
  2. vagrant up the box
  3. Install Vagrant and vagrant-aws inside the Vagrant box

Some really great answers posted here, really appreciate the effort from the community. But honestly, it's quite surprising there hasn't been any patch or update released for this blocker bug. It clearly seems to be a breaking change and (for me at least) has completely stalled my work.

@bdwyertech
Copy link

Please see #542 for a better option than all of the editing and such shown above.

@arungbinath
Copy link

Hi,
it is working . please do install ruby latest version on windows box. Then run vagrant update.

@savishy
Copy link

savishy commented Jun 12, 2018

@arungbinath I am not sure that solution is complete - please provide additional info so other visitors may benefit:

  • which ruby version, specifically are you talking about?
  • vagrant update is not a command. Do you mean updating the version of Vagrant? If so, which version?
  • To my knowledge, Vagrant packages its own Ruby. Does your solution involve pointing Vagrant to the system-installed Ruby?

@rurku
Copy link

rurku commented Jun 18, 2018

This workaround worked for me:

  1. Install fog-ovirt 1.0.1
    vagrant plugin install --plugin-version 1.0.1 fog-ovirt
  2. install vagrant-aws
    vagrant plugin install vagrant-aws

fog-ovirt is one of the dependencies and since version 1.0.2 it depends on ovirt-engine-sdk which is giving trouble

@ghost
Copy link

ghost commented Jun 21, 2018

Thanks @rurku , that worked for me!!!

@bdwyertech
Copy link

FWIW, the fog gem was broken out into multiple gems, one per service provider.

The right thing to do here is only install fog-aws, rather than the whole fog suite which installs truly unnecessary dependencies, like libvirt.

See #542 for proper resolution

@ghost
Copy link

ghost commented Jun 25, 2018

Thanks @rurku , ur solution worked for me as well thanks a lot, struck for a week !,it worked for me!

@03xAn29
Copy link

03xAn29 commented Jul 5, 2018

Gracias @rurku ,it worked for me!!

@rodriguezmalvis
Copy link

@rurku operative!

@clee-newclassrooms
Copy link

This is not fixed. It was never fixed here. The workaround described above is not a solution. Either merge #542 or fix this issue directly. It is ridiculous that this was closed without ever actually fixing anything.

@erastnicolae
Copy link

erastnicolae commented Dec 14, 2018

Thanks to @rurku (w7, cygwin 2.11.2, Vagrant 2.2.2) this worked for me:
$ vagrant plugin install vagrant-ovirt vagrant-aws
Installed the plugin 'vagrant-ovirt (0.0.2)'!
Installed the plugin 'vagrant-aws (0.3.0)'!

For version 0.7.2 of plugin you have to install "fog" before "aws"
$ vagrant plugin install fog --plugin-version=1.38
$ vagrant plugin install vagrant-aws --plugin-version=0.7.2
beside that I had to install the xmlrpc plugin to 0.3.0!

@omgreenfield
Copy link

omgreenfield commented Jan 16, 2019

So far, none of the recommend workarounds above have worked for me.

  • windows 10
  • vagrant 2.2.3
  • vagrant-aws 0.3.0
  • vagrant-ovirt 0.0.2
  • xmlrpc 0.3.0

It seems like this issue should be re-opened until a PR is merged in fixing it.

@rconde-bt
Copy link

I followed @bdwyertech's advice and installed his gem. It installed without a hitch. Now to see if it works!

C:\Users\rconde\Projects\canned-env-vagrant (AWS -> gitlab)
λ vagrant plugin install "C:\Users\rconde\Downloads\vagrant-aws-0.8.0.gem"
Installing the 'C:\Users\rconde\Downloads\vagrant-aws-0.8.0.gem' plugin. This can take a few minutes...
Fetching: iniparse-1.4.4.gem (100%)
Fetching: fog-core-2.1.2.gem (100%)
Fetching: fog-aws-3.3.0.gem (100%)
Successfully uninstalled dry-inflector-0.1.2
Successfully uninstalled fog-aliyun-0.3.2
Successfully uninstalled fog-atmos-0.1.0
Successfully uninstalled fog-aws-2.0.1
Successfully uninstalled fog-brightbox-0.16.1
Successfully uninstalled fog-cloudatcost-0.1.2
Successfully uninstalled fog-core-1.45.0
Successfully uninstalled fog-digitalocean-0.4.0
Removing console
Removing setup
Successfully uninstalled fog-dnsimple-1.0.0
Successfully uninstalled fog-dynect-0.0.3
Successfully uninstalled fog-ecloud-0.3.0
Successfully uninstalled fog-google-0.1.0
Successfully uninstalled fog-internet-archive-0.0.1
Successfully uninstalled fog-joyent-0.0.1
Successfully uninstalled fog-local-0.6.0
Successfully uninstalled fog-openstack-0.3.9
Successfully uninstalled xml-simple-1.1.5
Installed the plugin 'vagrant-aws (0.8.0)'!

I don't understand why this issue is marked as closed.

@comeback2000
Copy link

any one able to install vagrant AWS plugin successfully

@rconde-bt
Copy link

any one able to install vagrant AWS plugin successfully

I did using @bdwyertech's advice. I was just able to vagrant up a new instance in AWS!

@comeback2000
Copy link

this worked for me
This workaround worked for me:

Install fog-ovirt 1.0.1
vagrant plugin install --plugin-version 1.0.1 fog-ovirt
install vagrant-aws
vagrant plugin install vagrant-aws

@omgreenfield
Copy link

Attempted @comeback2000's fix, but did not working for me. Specifically:

vagrant plugin uninstall vagrant-aws
vagrant plugin install --plugin-version 1.0.1 fog-ovirt
vagrant plugin install vagrant-aws

Then vagrant reload

Then SSH in vagrant ssh

And bundle to install gem updates and fail on ovirt-engine-sdk

Fetching ovirt-engine-sdk 4.2.5
Installing ovirt-engine-sdk 4.2.5 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /home/vagrant/.rvm/gems/ruby-2.6.0/gems/ovirt-engine-sdk-4.2.5/ext/ovirtsdk4c

/home/vagrant/.rvm/rubies/ruby-2.6.0/bin/ruby -I /home/vagrant/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0

-r ./siteconf20190123-2213-1viu0tw.rb extconf.rb
checking for xml2-config... no
*** 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
        --without-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=/home/vagrant/.rvm/rubies/ruby-2.6.0/bin/$(RUBY_BASE_NAME)
        --with-libxml2-config
        --without-libxml2-config
        --with-pkg-config
        --without-pkg-config
extconf.rb:29:in `<main>': The "libxml2" package isn't available. (RuntimeError)

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

  /home/vagrant/.rvm/gems/ruby-2.6.0/extensions/x86_64-linux/2.6.0/ovirt-engine-sdk-4.2.5/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /home/vagrant/.rvm/gems/ruby-2.6.0/gems/ovirt-engine-sdk-4.2.5
for inspection.
Results logged to
/home/vagrant/.rvm/gems/ruby-2.6.0/extensions/x86_64-linux/2.6.0/ovirt-engine-sdk-4.2.5/gem_make.out


An error occurred while installing ovirt-engine-sdk (4.2.5), and Bundler cannot continue.
Make sure that `gem install ovirt-engine-sdk -v '4.2.5' --source 'https://rubygems.org/'` succeeds
before bundling.

In Gemfile:
  fog was resolved to 2.1.0, which depends on
    fog-ovirt was resolved to 1.1.4, which depends on
      ovirt-engine-sdk

@omgreenfield
Copy link

In case this helps anyone, I had the following in a project's Gemfile:

gem 'aws-sdk'
gem 'fog'

I uninstalled my old vagrant-aws plugin, downloaded the plugin from here, and installed it.

Then, I changed gem 'fog' to gem 'fog-aws' (I only need the aws part of the library anyway) and bundled.

It worked.

@troppens
Copy link

Windows 10 with Vagrant 2.2.3.
@rurku's workaround resolved my issue.

@mshannaq
Copy link

mshannaq commented Mar 8, 2019

This workaround worked for me:

  1. Install fog-ovirt 1.0.1
    vagrant plugin install --plugin-version 1.0.1 fog-ovirt
  2. install vagrant-aws
    vagrant plugin install vagrant-aws

fog-ovirt is one of the dependencies and since version 1.0.2 it depends on ovirt-engine-sdk which is giving trouble

This works with me, Thanks!

@SantoshVKamat
Copy link

FWIW, the fog gem was broken out into multiple gems, one per service provider.

The right thing to do here is only install fog-aws, rather than the whole fog suite which installs truly unnecessary dependencies, like libvirt.

See #542 for proper resolution

Thanks, This solution worked for me !!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.