ios - 我有一些问题 cocoapods 安装
问题描述
我正在尝试将 cocoapods 安装到我的 MacBook,在我将此代码运行到终端后,gem install cocoapods
我收到以下错误:
****** ~ % 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.6.0/gems/ffi-1.12.2/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 ./siteconf20200413-663-1dklrnl.rb extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/include/ruby.h
You might have to install separate package for the ruby development
environment, ruby-dev or ruby-devel for example.
extconf failed, exit code 1
Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/ffi-1.12.2 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/ffi-1.12.2/gem_make.out
解决方案
看起来您还没有安装 Ruby 开发标头。
您可以通过执行以下两个命令来安装 Xcode 命令行工具来解决此问题:
xcode-select --install
sudo xcodebuild -license
计算机重新启动后将应用更改。
推荐阅读
- python - 如何在 Python 中将女性和男性更改为 True 和 False
- android - 致命异常:main:PID:32439 java.lang.NullPointerException,我是 android 新手。请帮我解决这个问题,
- flutter - 我们可以在不使用 package_info 或 Flutter 中的任何其他依赖项的情况下获取应用程序版本名称吗?
- bigcommerce - BigCommerce 应用程序应如何使用第 3 方 API 进行身份验证?
- woocommerce - 在 WooCommerce 特色产品 Gutenberg 块中的描述中添加自定义字段
- swift - 在 NSGridView 中显示可编辑的 NSTextField
- google-cloud-firestore - react-quilljs 返回值是对象。如何将其保存到firestore
- node.js - 在同一个域(cpanel)上托管 angular 和 nodejs
- firebase - 在flutter firebase中调用了方法'[]'的空错误
- php - 如何解决,找不到模块“@nesk/rialto”错误