我大约两个月前使用 xcode 发布了一个 flutter 应用程序。回来做一些更新,我尝试运行 flutter build ipa 我收到 CocoaPods not Installed or not in valid state 错误。
尝试更新、重新安装,uinintall cocoapods 给出权限错误。
我正在 macOS ventura 上使用最新的 flutter 稳定版本。
这是我得到的确切错误: sudo gem install -n /usr/local/bin cocoapods 错误:执行 gem 时... (Gem::FilePermissionError) 您没有 /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0 目录的写入权限。
我尝试使用 CocoaPods 提供的故障排除网页但无济于事。 https://guides.cocoapods.org/using/troubleshooting#installing-cocoapods
Apple 论坛上的一些人帮助了我。 首先 cd 到您的项目文件,然后按顺序执行以下命令。
希望对你有帮助!
步骤1:
安装brew
curl -fsSL -o install.sh https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh
/bin/bash install.sh
第2步:
brew 安装 chruby ruby-install
步骤3:
brew 安装 cocoapods
第4步:(检查您的cocoapods版本):
brew升级cocoapods