You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Mac执行flutterfire configure命令时遭遇xcodeproj加载错误

问题描述

在Mac上执行flutterfire configure命令时触发未处理异常,错误提示无法加载xcodeproj文件(LoadError),完整报错堆栈如下:

Unhandled exception:
Exception: /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- xcodeproj (LoadError)
        from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from -e:1:in `<main>'

#0      ConfigCommand.run (package:flutterfire_cli/src/commands/config.dart:517:11)
<asynchronous suspension>
#1      CommandRunner.runCommand (package:args/command_runner.dart:209:13)
<asynchronous suspension>
#2      main (file:///Users/dylanguzman/.pub-cache/hosted/pub.dartlang.org/flutterfire_cli-0.2.6+1/bin/flutterfire.dart:57:5)
<asynchronous suspension>

执行以下命令后:

flutterfire configure --project=test-app-egr423

Firebase配置文件lib/firebase_options.dart已成功生成,包含对应的Firebase应用配置。

解决方案
  • 安装xcodeproj Ruby gem:报错原因是Ruby环境缺少xcodeproj库,执行命令安装:
    sudo gem install xcodeproj
    
    若系统Ruby权限不足,建议用rbenv或rvm管理独立Ruby版本后再安装,避免修改系统默认Ruby环境。
  • 重新执行配置命令:安装完成后再次运行flutterfire configure即可规避该异常。

内容的提问来源于stack exchange,提问作者Dylan Guzman

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.14 00:50:38