ios - 安装 Ruby gem 'cocoapods' 失败
问题描述
我尝试将 cocoapods 合并到我的 fastlane 构建中。根据应该像在我的 Fastfile 中添加一行一样简单的文档:
cocoapods
这应该会打电话pod install
给我。但情况似乎并非如此。而不是仅仅调用pod install
fastlane 尝试安装 cocoapods ,然后失败:
[16:32:36]: Installing Ruby gem 'cocoapods'...
Building native extensions. This could take a while...
+------------------+-----------------+
| Lane Context |
+------------------+-----------------+
| DEFAULT_PLATFORM | ios |
| PLATFORM_NAME | ios |
| LANE_NAME | ios kptapp_TEST |
+------------------+-----------------+
[16:32:52]: ERROR: Failed to build gem native extension.
current directory: /usr/local/Caskroom/fastlane/latest/fastlane_lib/bundle/lib/ruby/gems/2.2.0/gems/ffi-1.12.2/ext/ffi_c
/usr/local/Caskroom/fastlane/latest/fastlane_lib/bundle/bin/ruby -r ./siteconf20200309-76244-14k7phf.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.
特别奇怪的是:cocoapods 已经安装好了:
>which pod
/usr/local/bin/pod
无需安装。如前所述,文档没有说明这一点。任何提示或指针。
更新 1:
注意到一些有趣的事情。打电话时fastlane env
我得到:
| Key | Value |
| --------------------------- | -------------------------------------------------------------------- |
| Ruby | 2.2.4 |
但实际安装的摩擦是:
>ruby --version
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin19]
看起来 fastlane 使用了错误的 ruby。
解决方案
推荐阅读
- javascript - 使用模糊事件,我如何确保模糊事件在提交按钮之前发生?
- python - 使用 acs5.get 在 python 中访问人口普查 acs5 中位数收入块组数据
- logging - Paramiko 日志记录配置
- sql-server - 在我的金额字段中查找任何连续整数的 SQL 查询
- laravel - 未捕获的反射异常:805
- java - 使用 freemarker 模板发生错误配置失败
- xamarin - 是否有一次多次调用应用程序 OnStart 方法。如果是,为什么建议将 AppCenter.Start 放在那里?
- swift - 如何检查窗口是否打开?
- c++ - HitTest 没有返回正确的值
- flutter - 在颤振中使用 android_alarm_manager 运行后台任务