首页 > 其他分享 >Mac OS 12.6 cocoapods 安装失败

Mac OS 12.6 cocoapods 安装失败

时间:2023-01-04 23:14:21浏览次数:74  
标签:lib -- OS Library Mac 12.6 rb Ruby 2.6

sudo gem install cocoapods 报错

Building native extensions. This could take a while...
ERROR:  Error installing cocoapods:
	ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20230104-2595-144dc4a.rb extconf.rb
checking for ffi.h... *** 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=/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: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:585:in `block in try_compile'
	from /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/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:585:in `try_compile'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1109:in `block in have_header'
	from /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 `open'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in `block in postpone'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in `open'
	from /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/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:958:in `checking_for'
	from /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?'
	from extconf.rb:42:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-21/2.6.0/ffi-1.15.5/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-21/2.6.0/ffi-1.15.5/gem_make.out

提示里的日志被冲了
解决方法为

cd $(xcode-select -p)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0 && sudo ln -s universal-darwin22 universal-darwin21

参考 GitHub 某老哥

标签:lib,--,OS,Library,Mac,12.6,rb,Ruby,2.6
From: https://www.cnblogs.com/seliote/p/17026266.html

相关文章

  • Watt Toolkit(原steam++)的host代理443端口被占用的问题(通解)
    因为某些原因需要使用443端口,但服务总是启动不了,提示443端口被占用,于是查询了一下,win+R→cmd→netstat-aon|findstr“443”,找到443端口对应的进程PIDctrl+alt+delete......
  • scrapy 的post请求
      importscrapyimportjsonclassTestpostSpider(scrapy.Spider):name='testpost'allowed_domains=['https://fanyi.baidu.com/sug']#post......
  • hmac php java结果不一样问题
    比如我们有个服务是PHP提供的,要求的签名方式hmacSha256取摘要,然后Base64编码转化成可见字符。PHP那边的源码是这样的$result=base64_encode(hash_hmac("SHA256"......
  • hmacSha256 php java结果不一样问题
    比如我们有个服务是PHP提供的,要求的签名方式hmacSha256取摘要,然后Base64编码转化成可见字符。PHP那边的源码是这样的$result=base64_encode(hash_hmac("SHA256"......
  • BlockingQueue之LifoSemMPMCQueue
    【五种阻塞队列】  【先看LifoSem】lastinfirstout信号量通知的queue【调用栈】  ./fbcode_builder_getdeps-ZrootZfollyZbuildZfbcode_builder-root/buil......
  • Microsoft Remote Desktop for mac(远程桌面连接工具) v10.8.0中文正式版
    mac版微软远程桌面连接工具MicrosoftRemoteDesktop哪里可以下载?MicrosoftRemoteDesktopforMac中文正式版是一款非常优秀的远程桌面连接工具,可以帮助您快速连接到基于......
  • mac版达芬奇软件DaVinci Resolve Studio 18 v18.1.2B6密钥版
    mac版达芬奇软件哪里可以下载呢?小编为大家带来了mac版达芬奇软件DaVinciResolveStudio18v18.1.2B6密钥版,DaVinciResolve18破解版新增了几十项新功能和流程改进,使得剪......
  • AFD在CentOS环境中部署
    在第一节中(http://www.htz.pw/?p=1207)介绍了AFD的功能和常见的问题,其中提到AFD是内核模块,需要匹配的系统版本和内核版本匹配才能安装AFD,并且也提到Oracle未认证CentOS平台......
  • AFD在CentOS环境中的部署
    今天是AFD技术分享的第二节:AFD在CentOS环境中的部署在第一节中(http://www.htz.pw/?p=1207)介绍了AFD的功能和常见的问题,其中提到AFD是内核模块,需要匹配的系统版本和内核版......
  • Dos命令以及特性和版本
    #基本的Dos命令 ##打开CMD的方式 1.开始+系统+命令提示符2.win键+R输入CMD打开控制台3.在任意文件夹下面,按住Shift键+鼠标右击,在此处打开命令窗口4.资源管理......