gpt4 book ai didi

xcode - 无法在终端 macOS 10.15.7 上安装 cocoapods

转载 作者:行者123 更新时间:2023-12-04 17:22:54 24 4
gpt4 key购买 nike

当我像这样在终端上输入时:

sudo gem install -n /usr/local/bin cocoapods

它向我显示这样的错误:

Building native extensions. This could take a while...

错误:安装 cocoapods 时出错:错误:无法构建 gem native 扩展。

current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1/ext/ffi_c

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I/Library/Ruby/Site/2.6.0 -r ./siteconf20201203-2632-pfzsbj.rb extconf.rb检查 ffi.h... *** extconf.rb 失败 ***由于某种原因无法创建 Makefile,可能是缺少必要的库和/或标题。检查 mkmf.log 文件以获取更多详细信息。你可以需要配置选项。

提供的配置选项:--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--源目录=。--curdir--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME)--with-ffi_c-目录--without-ffi_c-目录--with-ffi_c-include--without-ffi_c-include=${ffi_c-dir}/include--with-ffi_c-lib--without-ffi_c-lib=${ffi_c-dir}/lib--enable-system-libffi--disable-system-libffi--with-libffi-配置--without-libffi-config--with-pkg-config--without-pkg-config/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:467:in try_do': 编译器未能生成可执行文件。 (RuntimeError) 你必须先安装开发工具。来自/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:585:in try_compile 中的 block 来自/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:534:in with_werror' from/System/Library/Frameworks/Ruby.framework/版本/2.6/usr/lib/ruby/2.6.0/mkmf.rb:585:in try_compile'来自/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1109:in block in have_header' 来自/System/Library/Frameworks/Ruby。 framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:959:in block in checking_for'from/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in block (2 levels) in postpone' from/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in 打开'来自/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in block in postpone' 来自/System/Library/Frameworks/Ruby。 framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in 打开'来自/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:357:in postpone' from/System/Library/Frameworks/Ruby.framework/版本/2.6/usr/lib/ruby/2.6.0/mkmf.rb:958:in checking_for'来自/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1108:in have_header' from extconf.rb:10:in system_libffi_usable?'来自 extconf.rb:42:in `'

要了解此扩展编译失败的原因,请查看可在此处找到的 mkmf.log:

/Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/ffi-1.13.1/mkmf.log

extconf 失败,退出代码 1

Gem 文件将保留安装在/Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1 中以供检查。结果记录到/Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/ffi-1.13.1/gem_make.out

之后我试着输入:

pod setup --verbose

它显示这样的错误:

-bash: /usr/local/bin/pod: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: bad interpreter: No such file or directory

请帮助我解决这个问题,这样我就可以像升级到 MacOS Catalina 10.15.7 之前一样使用 cocoapods

最佳答案

出现此错误时,我建议使用homebrew 安装 CocoaPods。

如果你还没有,运行:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

然后你可以安装 CocoaPods:

brew install cocoapods

关于xcode - 无法在终端 macOS 10.15.7 上安装 cocoapods,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65119063/

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