当我运行以下命令时,会出现此错误。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 ./siteconf20200302-707-1iveybq.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
sudo gem install cocoapods
sudo gem install -n /usr/local/bin cocoapods
我已经安装了xcode命令行工具,并且当我运行xcode-select --install
时,我收到以下消息:
xcode-select: 错误:命令行工具已经安装,请使用“软件更新”安装更新
我还同意了xcode许可协议,使用命令sudo xcodebuild -license
/Library/Ruby/Gems/2.3.0/extensions/universal-darwin-18/2.3.0/ffi-1.12.2/gem_make.out
中的错误日志如下:
当前目录:/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 ./siteco$ mkmf.rb无法找到ruby头文件 /System/Library/Frameworks/Ruby.fra$处的extconf失败,退出代码为1
我该怎么解决这个问题?
ruby --version
。 - Rob C