Cocoapods 安装 -

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
补充安装cocoapods的命令,该命令只安装新添加的库,已更新的库忽略
pod install --verbose --no-repo-update

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

error
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容