gpt4 book ai didi

ruby - Gem::Ext::BuildError:错误:无法构建 gem native 扩展 - nio4r

转载 作者:数据小太阳 更新时间:2023-10-29 07:39:05 26 4
gpt4 key购买 nike

我正在尝试在我的 gemfile 及其依赖项中安装所有 gem,因此只需运行 Bundler(捆绑或捆绑安装)。使用原生扩展安装 nio4r 1.1.1 时失败,下面是登录 gem_make.out。

/opscode/chef/embedded/bin/ruby.exe -r ./siteconf20150924-7480-ocwr34.rb extconf.rbchecking for unistd.h... *** extconf.rb failed ***Could not create Makefile due to some reason, probably lack of necessarylibraries and/or headers.  Check the mkmf.log file for more details.  You mayneed 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=/opscode/chef/embedded/bin/ruby/opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:434:in `try_do': The compiler failed to generate an executable file. (RuntimeError)You have to install development tools first.    from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:565:in `try_cpp'    from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:1038:in `block in have_header'    from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:889:in `block in checking_for'    from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:340:in `block (2 levels) in postpone'    from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:310:in `open'    from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:340:in `block in postpone'    from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:310:in `open'    from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:336:in `postpone'    from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:888:in `checking_for'    from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:1037:in `have_header'    from extconf.rb:3:in `'extconf failed, exit code 1

我可以看到 bundler 正在检查 unistd.h,但此时失败了。我确保此 header 在 PATH 中可用,并且还为我的版本安装了 ruby​​ devkit。执行 gem install nio4r 也会出现同样的错误。

最佳答案

首先尝试xcode-select --install。这可能是xcode构建系统的问题

关于ruby - Gem::Ext::BuildError:错误:无法构建 gem native 扩展 - nio4r,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32762628/

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