首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在OS上安装迷航器-libvirt插件时出错

在OS上安装迷航器-libvirt插件时出错
EN

Stack Overflow用户
提问于 2022-03-06 14:36:47
回答 1查看 1.1K关注 0票数 2

我在运行vagrant plugin install vagrant-libvirt时遇到了下面的错误

设置

  1. 安装国产啤酒 /bin/bash -c $(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)
  2. 用自制软件安装 brew安装--木桶流浪汉&& brew安装使gcc qemu libiconv libvirt
  3. 双重检查libvirt路径
代码语言:javascript
复制
➜  ~ brew --prefix libvirt
/opt/homebrew/opt/libvirt

更新路径

代码语言:javascript
复制
HOMEBREW_HOME="/opt/homebrew/opt"
LIBICONV_HOME="$HOMEBREW_HOME/libiconv"

export PATH="$LIBICONV_HOME/bin:$PATH"
export PATH="$HOMEBREW_HOME/make/libexec/gnubin:$PATH"
export LDFLAGS="-L$LIBICONV_HOME/lib"
export CPPFLAGS="-I$LIBICONV_HOME/include"
export CONFIGURE_ARGS="with-libvirt-lib=$(brew --prefix libvirt)/lib with-libvirt-include=$(brew --prefix libvirt)/include"

错误

代码语言:javascript
复制
➜  ~ vagrant plugin install vagrant-libvirt

Installing the 'vagrant-libvirt' plugin. This can take a few minutes...
Fetching formatador-1.1.0.gem
Fetching fog-core-2.3.0.gem
Fetching fog-json-1.2.0.gem
Fetching nokogiri-1.13.9-x86_64-darwin.gem
Fetching fog-xml-0.1.4.gem
Fetching ruby-libvirt-0.8.0.gem
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/yakforward/.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 ./siteconf20221111-11883-1v7zec5.rb extconf.rb
Looking for libvirt in /opt/homebrew/opt/libvirt/include and /opt/homebrew/opt/libvirt/lib
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
    --with-libvirt-lib
    --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/yakforward/.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/yakforward/.vagrant.d/gems/2.7.6/gems/ruby-libvirt-0.8.0 for inspection.
Results logged to /Users/yakforward/.vagrant.d/gems/2.7.6/extensions/x86_64-darwin-19/2.7.0/ruby-libvirt-0.8.0/gem_make.out
代码语言:javascript
复制
 info 
代码语言:javascript
复制
➜  ~ neofetch
                    'c.          yakforward@yakforward.local
                 ,xNMM.          ---------------------------
               .OMMMMo           OS: macOS 13.0.1 22A400 arm64
               OMMM0,            Host: MacBookAir10,1
     .;loddo:' loolloddol;.      Kernel: 22.1.0
   cKMMMMMMMMMMNWMMMMMMMMMM0:    Uptime: 53 mins
 .KMMMMMMMMMMMMMMMMMMMMMMMWd.    Packages: 89 (brew)
 XMMMMMMMMMMMMMMMMMMMMMMMX.      Shell: zsh 5.8.1
;MMMMMMMMMMMMMMMMMMMMMMMM:       Resolution: 1440x900
:MMMMMMMMMMMMMMMMMMMMMMMM:       DE: Aqua
.MMMMMMMMMMMMMMMMMMMMMMMMX.      WM: Quartz Compositor
 kMMMMMMMMMMMMMMMMMMMMMMMMWd.    WM Theme: Blue (Dark)
 .XMMMMMMMMMMMMMMMMMMMMMMMMMMk   Terminal: iTerm2
  .XMMMMMMMMMMMMMMMMMMMMMMMMK.   Terminal Font: Monaco 12
    kMMMMMMMMMMMMMMMMMMMMMMd     CPU: Apple M1
     ;KMMMMMMMWXXWMMMMMMMk.      GPU: Apple M1
       .cooc,.    .,coo:.        Memory: 1129MiB / 8192MiB
代码语言:javascript
复制
➜  ~  vagrant --version
Vagrant 2.3.2

日志

mkmf.log make.out.zip

EN

回答 1

Stack Overflow用户

发布于 2022-03-15 22:53:37

步骤1:

brew install qemu gcc libvirt.

第2步:

代码语言:javascript
复制
echo 'security_driver = "none"' >> /usr/local/etc/libvirt/qemu.conf
echo "dynamic_ownership = 0" >> /usr/local/etc/libvirt/qemu.conf
echo "remember_owner = 0" >> /usr/local/etc/libvirt/qemu.conf

如果这不适用于您,请尝试本教程这一个

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71371218

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档