替换Gems源(使用清华镜像https://mirrors.tuna.tsinghua.edu.cn/help/rubygems/)

遇到Ruby版本问题

更新 Ruby 版本
1. 安装 Homebrew(如果没有安装的话):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"


2. 更新 Ruby:
brew install ruby

安装cocoapods
安装后运行pod指令
zsh: command not found: pod
运行以下命令查看是否安装了 CocoaPods:
gem list cocoapods
如果未安装,重新安装
如果已安装,说明gem 安装的 pod 命令没有被正确添加到 PATH 环境变量中。查找安装路径
find / -name pod 2>/dev/null

打开.zshrc文件,添加环境变量

网友评论