无法在MacOS 12.0 Beta和Xcode版本13.0中安装Cocoapods。
以下是使用sudo gem install cocoapods命令时的终端输出。
userName@users-Mac-mini ~ % sudo gem install cocoapods Password: 构建本地扩展,这可能需要一段时间... 错误:安装Cocoapods时出错: 错误:无法构建宝石本地扩展。
当前目录:/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.4/ext/ffi_c /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /Library/Ruby/Site/2.6.0 -r ./siteconf20211006-2973-16tlcws.rb extconf.rb *** 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 --srcdir=. --curdir --ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME) --with-ffi_c-dir --without-ffi_c-dir --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-config --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:intry_do': 编译器无法生成可执行文件。(RuntimeError) 请先安装开发工具。 from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:546:in
block in try_link0'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/tmpdir.rb:93:in mktmpdir' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:543:in
try_link0'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:570:in try_link' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:672:in
try_ldflags'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1832:in pkg_config' from extconf.rb:9:in
system_libffi_usable?'
from extconf.rb:42:in `'
若要查看为何此扩展程序无法编译,请检查以下位置中的mkmf.log:
/Library/Ruby/Gems/2.6.0/extensions/universal-darwin-21/2.6.0/ffi-1.15.4/mkmf.log
extconf 失败,退出码为 1。
宝石文件将保留在 /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.4 用于检查。结果记录在 /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-21/2.6.0/ffi-1.15.4/gem_make.out 中。