2021-04-19 cocopods 安装

安装HOMEBREW

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

报错换HOST

sudo vim /etc/hosts
99.232.28.133 raw.githubusercontent.com
或者switchHosts 添加HOST https://www.ipaddress.com/ 查看地址=
修改完成,再执行安装命令:

brew -v

得到结果:
Homebrew 2.7.0
接着安装RVM,命令:

curl -L https://get.rvm.io | bash -s stable

很好,很顺利。载入rvm环境,命令:

source ~/.rvm/scripts/rvm

再来查看一下ruby已知版本,命令:

rvm list known

根据结果,挑选一个你想安装的ruby版本,我装的2.6.5,命令:

rvm install 2.6.5

关掉终端,重开查一下ruby的版本,命令:

ruby -v

//查看源

gem sources -l

//移除默认源

gem sources --remove https://rubygems.org/

//换成可用源

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

//再查看更换源是否成功

gem sources -l

//安装cocoapods

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

你可能感兴趣的:(2021-04-19 cocopods 安装)