macbook m1,m2 安装cocoapods

 1.安装Homebrew

/bin/zsh -c "$(curl -fsSL https://gitee.com/huwei1024/HomebrewCN/raw/master/Homebrew.sh)"

安装成功

如果出现 zsh: command not found: brew

解决方法如下:

打开终端

1.1)执行执行以下命令: 

 echo "export PATH=$PATH:/opt/homebrew/bin" >> ~/.zprofile

1.2)执行命令:

export PATH=$PATH:/opt/homebrew/bin

1.3)最后执行:

source ~/.zprofile

2.验证你的Ruby镜像是并且仅是ruby-china,执行以下命令查看:

gem sources -l

2.1)查看结果;

  1. *** CURRENT SOURCES ***

  2. https://gems.ruby-china.com/

2.2)  如果不是执行以下代码

移除输入:gem sources --remove https://rubygems.org/

移除后添加源:输入:gem sources --add https://gems.ruby-china.com

查看是否添加成功:输入:gem sources -l

3.安装cocoapods

sudo gem install -n /usr/local/bin cocoapods

查看cocoapods版本:

pod --version

你可能感兴趣的:(cocoapods,xcode)