欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 教育 > 幼教 > 解决macOS搭建flutter错误 CocoaPods not installed

解决macOS搭建flutter错误 CocoaPods not installed

2025/9/19 6:59:53 来源:https://blog.csdn.net/qq_37703224/article/details/142521387  浏览:    关键词:解决macOS搭建flutter错误 CocoaPods not installed

浏览地址: https://guides.cocoapods.org/using/getting-started.html#installation

在这里插入图片描述

先安装gem:

brew install gem

在这里插入图片描述

根据提示,要安装Ruby:

brew install ruby

在这里插入图片描述

根据提示:

If you need to have ruby first in your PATH, run:echo 'export PATH="/opt/homebrew/opt/ruby/bin:$PATH"' >> ~/.zshrcFor compilers to find ruby you may need to set:export LDFLAGS="-L/opt/homebrew/opt/ruby/lib"export CPPFLAGS="-I/opt/homebrew/opt/ruby/include"

进行如下配置:

export PATH="/opt/homebrew/opt/ruby/bin:$PATH"
export LDFLAGS="-L/opt/homebrew/opt/ruby/lib"
export CPPFLAGS="-I/opt/homebrew/opt/ruby/include"

此时, 就有gem这个命令了:
在这里插入图片描述

安装命令:

sudo gem install cocoapods

这一步安装的东西比较多, 可能等待的时间比较长:
在这里插入图片描述

查看安装位置:

gem which cocoapods

再配一个环境变量:

export PATH="/Users/zhangdapeng/.local/share/gem/ruby/3.3.0/bin:$PATH"

最后执行下面的命令检查:

fluttor doctor

在这里插入图片描述

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词