gpt4 book ai didi

ruby - 需要 C 扩展的 rbenv 和 gem

转载 作者:太空宇宙 更新时间:2023-11-03 18:20:37 24 4
gpt4 key购买 nike

所以我正在尝试安装 audite gem , 但 rbenv 有问题:

$ bundle install
Fetching gem metadata from https://rubygems.org/...
Installing audite (0.3.0)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/opt/boxen/rbenv/versions/1.9.3-p448/bin/ruby extconf.rb
checking for mpg123.h... 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=/opt/boxen/rbenv/versions/1.9.3-p448/bin/ruby
please install mpg123 headers


Gem files will remain installed in /opt/boxen/rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/audite-0.3.0 for inspection.
Results logged to /opt/boxen/rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/audite-0.3.0/ext/mpg123/gem_make. out

An error occurred while installing audite (0.3.0), and Bundler cannot continue.
Make sure that `gem install audite -v '0.3.0'` succeeds before bundling.

我知道这些 gems 需要 c 扩展,我用 Homebrew 软件安装了它们。如果我进入地窖寻找 Homebrew 软件,我可以看到它正在寻找的文件 (mpg123.h)

/opt/boxen/homebrew/Cellar/mpg123/1.15.4/include/mpg123.h

那么,有没有一种方法可以将其添加到 rbenv 环境中,而无需直接链接或将其直接复制到 /opt/boxen/rbenv/versions/1.9.3-p448/

最佳答案

xcode-select --install

帮我解决了。

关于ruby - 需要 C 扩展的 rbenv 和 gem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19162129/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com