首页 > 解决方案 > Windows 10 - vagrant plugin install vagrant-aws - “libxml2” 包不可用。(运行时错误)

问题描述

尝试为 vagrant 安装 aws 插件。出现依赖错误。

日志显示...

find_executable: checking for xml2-config... -------------------- no

--------------------

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

控制台输出:

C:\Users\jkittell\Documents\Schedule3> vagrant plugin install vagrant-aws
Installing the 'vagrant-aws' 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: C:/Users/jkittell/.vagrant.d/gems/2.4.4/gems/ovirt-engine-sdk-4.2.4/ext/ovirtsdk4c
C:/HashiCorp/Vagrant/embedded/mingw64/bin/ruby.exe -r ./siteconf20181002-19764-xj4q7a.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=C:/HashiCorp/Vagrant/embedded/mingw64/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:

  C:/Users/jkittell/.vagrant.d/gems/2.4.4/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/jkittell/.vagrant.d/gems/2.4.4/gems/ovirt-engine-sdk-4.2.4 for inspection.
Results logged to C:/Users/jkittell/.vagrant.d/gems/2.4.4/extensions/x64-mingw32/2.4.0/ovirt-engine-sdk-4.2.4/gem_make.out
PS C:\Users\jkittell\Documents\Schedule3>

标签: amazon-web-serviceswindows-10vagrant

解决方案


我做了一个谷歌搜索,并找到了一个修补程序

宝石文件可在此处获得。只需安装一个 vagrant 插件 ~/PATH/TO/vagrant-aws-0.8.0.gem

我必须先安装fog-aws插件,然后它才能工作。

vagrant plugin install fog-aws

控制台输出:

PS C:\Users\jkittell\Documents\Schedule3> vagrant plugin install ..\..\Downloads\vagrant-aws-0.8.0.gem
Installing the '..\..\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%)
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:

conflicting dependencies fog-aws (= 2.0.1) and fog-aws (~> 3.0)
  Activated fog-aws-3.3.0
  which does not match conflicting dependency (= 2.0.1)

  Conflicting dependency chains:
    vagrant-aws (= 0.8.0), 0.8.0 activated, depends on
    fog-aws (~> 3.0), 3.3.0 activated

  versus:
    fog-aws (= 2.0.1)

PS C:\Users\jkittell\Documents\Schedule3> vagrant plugin install fog-aws
Installing the 'fog-aws' plugin. This can take a few minutes...
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.6
Successfully uninstalled xml-simple-1.1.5
Installed the plugin 'fog-aws (3.3.0)'!
PS C:\Users\jkittell\Documents\Schedule3> vagrant plugin install ..\..\Downloads\vagrant-aws-0.8.0.gem
Installing the '..\..\Downloads\vagrant-aws-0.8.0.gem' plugin. This can take a few minutes...
Installed the plugin 'vagrant-aws (0.8.0)'!
PS C:\Users\jkittell\Documents\Schedule3> vagrant plugin install vagrant-aws
Installing the 'vagrant-aws' plugin. This can take a few minutes...
Installed the plugin 'vagrant-aws (0.8.0)'!
PS C:\Users\jkittell\Documents\Schedule3>

推荐阅读