localhost:hello_world hzq$ sudo gem install cocoapods
Password:
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.3.0/gems/ffi-1.12.2/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20200515-68310-1ngv24.rb extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /Library/Ruby/Gems/2.3.0/gems/ffi-1.12.2 for inspection.
Results logged to /Library/Ruby/Gems/2.3.0/extensions/universal-darwin-18/2.3.0/ffi-1.12.2/gem_make.out
网友解决
#open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
#sudo gem install cocoapods
本文档详细记录了在本地主机上使用sudo命令安装CocoaPods时遇到的错误,错误信息显示未能构建gem原生扩展。通过查找Ruby头文件失败导致的配置错误,一位网友提供了解决方案,建议安装macOS SDK头文件并重新尝试安装CocoaPods。
1362

被折叠的 条评论
为什么被折叠?



