技术文章

Cocoapods 安装

2022-12-05  本文已影响0人  Mr_Zhou

1、查询Ruby的源地址

gem source -l

2、替换国内Ruby镜像源

gem sources --remove https://rubygems.org/
gem sources --add https://gems.ruby-china.com/

3、安装homebrew,执行下面代码时会检测Xcode,Command Line是否下载,建议提前下载好Xcode,否则会很慢。

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

4、homebrew安装完后会有提示,按照提示执行命令


执行对应的命令

5、安装rvm(逐步运行命令)

curl -L get.rvm.io | bash -s stable

source ~/.bashrc

source ~/.bash_profile

6、安装ruby

rvm install 3.0.0

7、设置成默认版本

rvm use 3.0.0 --default

8、安装cocoapods

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

后面pod install遇到了一个问题,这里需要手动更新git,如果没下载下来就click here to download manually

error
上一篇 下一篇

猜你喜欢

热点阅读