ruby3.2删除了对 exists 的支持导致以下问题。
不升级Flutter SDK 前提下:降低版本解决。
[!] Invalid `Podfile` file: undefined method `exists?' for File:Class.
# from /Users/tt/flutterApp/ios/Podfile:34
# -------------------------------------------
#
> flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
# end
# -------------------------------------------
brew install ruby.1
echo 'export PATH="/opt/homebrew/opt/ruby@3.1/bin:$PATH"' >> ~/.zshrc
gem install cocoapods
echo 'export PATH="/opt/homebrew/lib/ruby/gems/3.1.0/bin:$PATH"' >> ~/.zshrc
/opt/homebrew 改成你自己的路径
以上配置完成
重要的一点:需要关机重启 !!!