在 MacOS ARM 上安装 libvirt-vagrant 崩溃(无法构建 gem 原生扩展)

在 MacOS ARM 上安装 libvirt-vagrant 崩溃(无法构建 gem 原生扩展)

我正在尝试在我的 MacOS ARM(Monterey)上安装插件 Vagrant-libvirt,但我无法安装该插件vagrant-libvirt

我之前用 brew 安装了这些包:

brew install --cask vagrant && \
brew install make gcc qemu libiconv libvirt

然后我尝试安装插件(在另一个终端) vagrant plugin install vagrant-libvirt

然后它崩溃了

me@MacBook-Pro-de-Damien ~ % vagrant plugin install vagrant-libvirt
Installing the 'vagrant-libvirt' plugin. This can take a few minutes...
Building native extensions. This could take a while...
Vagrant failed to properly resolve required dependencies. These
errors can commonly be caused by misconfigured plugin installations
or transient network issues. The reported error is:

ERROR: Failed to build gem native extension.

    current directory: /Users/me/.vagrant.d/gems/2.7.6/gems/ruby-libvirt-0.8.0/ext/libvirt
/opt/vagrant/embedded/bin/ruby -I /opt/vagrant/embedded/lib/ruby/2.7.0 -r ./siteconf20221208-22001-c3kl00.rb extconf.rb
Looking for libvirt using pkg-config
checking for virConnectOpen() in -lvirt... 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
    --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)
    --with-libvirt-include
    --without-libvirt-include
    --with-libvirt-lib
    --without-libvirt-lib
    --with-libvirt-config
    --without-libvirt-config
    --with-pkg-config
    --without-pkg-config
    --with-virt-dir
    --without-virt-dir
    --with-virt-include
    --without-virt-include=${virt-dir}/include
    --with-virt-lib
    --without-virt-lib=${virt-dir}/lib
    --with-virtlib
    --without-virtlib
extconf.rb:44:in `<main>': No working libvirt installation found (RuntimeError)

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

  /Users/me/.vagrant.d/gems/2.7.6/extensions/x86_64-darwin-19/2.7.0/ruby-libvirt-0.8.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Users/me/.vagrant.d/gems/2.7.6/gems/ruby-libvirt-0.8.0 for inspection.
Results logged to /Users/me/.vagrant.d/gems/2.7.6/extensions/x86_64-darwin-19/2.7.0/ruby-libvirt-0.8.0/gem_make.out

但看起来我的 libvirt 可以工作,我尝试重新启动,但没有变化 brew services restart libvirt

你有什么主意吗 ?

相关内容