- 查看ruby源
- gem source -l
- 移除现有的Ruby源
- gem source --remove xxx
- 修改为新Ruby源
- gem source -a https://gems.ruby-china.com
- 安装cocoapods
- sudo gem install cocoapods
- 如果安装存在问题,升级gem
- sudo gem update --system
- 再次尝试安装cocoapods
- sudo gem install cocoapods
-
如果报错文件权限有问题
image.png - 添加参数,再次尝试安装cocoapods,安装成功
- sudo gem install -n /usr/local/bin cocoapods
- 查看pod版本
- pod --version
- 执行pod setup
- pod setup
网友评论