执行flutterfire configure命令时遇xcodeproj加载失败异常
解决flutterfire configure时xcodeproj加载失败问题
问题根源
执行flutterfire configure --project=fir-demo-54e7c时出现的cannot load such file -- xcodeproj错误,是因为你的Ruby环境缺少xcodeproj这个Gem包,而flutterfire configure在配置iOS项目时依赖该包。
解决步骤
- 首先确认当前Ruby版本(可选):
ruby -v - 安装
xcodeprojGem包:- 若使用系统Ruby,需加
sudo获取权限:sudo gem install xcodeproj - 若使用rbenv、rvm这类Ruby版本管理工具,直接执行:
gem install xcodeproj
- 若使用系统Ruby,需加
- 若安装失败(如网络问题),可切换Ruby Gem源后重试:
# 添加国内源并移除默认源 gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/ # 再次安装 gem install xcodeproj - 安装完成后,重新执行Firebase配置命令:
flutterfire configure --project=fir-demo-54e7c
内容的提问来源于stack exchange,提问作者user8852538
相关产品推荐
相关产品推荐

