无法在 MacOS 12.0 Beta 和 Xcode 版本 13.0 中安装 Cocoapods
这是sudo gem install cocoapods的终端输出
userName@users-Mac-mini ~ % sudo gem install cocoapods 密码:构建原生扩展。这可能需要一段时间... 错误:安装 cocoapods 时出错:错误:无法构建 gem 原生扩展。
当前目录:/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 failed *** 由于某种原因无法创建 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-包括 --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:in try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. 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:在mktmpdir' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:543:in
try_link0' 来自 /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' 来自 /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?来自 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
Gem 文件将继续安装在 /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