我正在尝试在Windows 10计算机上运行gem install ovirt-engine-sdk
,并且遇到以下问题:
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:/Ruby25-x64/lib/ruby/gems/2.5.0/extensions/x64-mingw32/2.5.0/ovirt-engine-sdk-4.2.5/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/ovirt-engine-sdk-4.2.5 for inspection.
Results logged to
C:/Ruby25-x64/lib/ruby/gems/2.5.0/extensions/x64-mingw32/2.5.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'` succeeds before
bundling.
In Gemfile:
fog was resolved to 2.1.0, which depends on
fog-ovirt was resolved to 1.1.2, which depends on
ovirt-engine-sdk
我尝试过:
--without-libxml2-config
,--without-libxml2-config
,...参数ruby 2.5.3p105 (2018-10-18 revision 65156) [x64-mingw32]
我的想法不多了,因此,如果有人可以帮助我摆脱困境,那将不胜感激!
非常感谢您!
答案 0 :(得分:2)
I'm unfamiliar with ovirt-engine-sdk, and can't find any information on their github to imply they support windows (it's not guaranteed, especially for gems with native extensions). But we can definitely work around this particular error. To help show you how to deal with similar problems in the future, here's my process to troubleshoot this.
$ gem fetch ovirt-engine-sdk
$ gem unpack ovirt-engine-sdk-4.3.0.gem
$ cat ovirt-engine-sdk-4.3.0/ext/ovirtsdk4c/extconf.rb
The relevant portion is here
xml2_config = find_executable('xml2-config')
if xml2_config
# other stuff
elsif !pkg_config('libxml2')
raise 'The "libxml2" package isn\'t available.'
end
We can see it's checking for an executable named xml2-config
. According to the documentation for find_executable, it checks your path for that.
So, this means we need two things to fix this error:
You can download from here - Then add the entire bin folder to your path.