1. 程式人生 > >iOS 升級cocoapods

iOS 升級cocoapods

1. 檢測gem版本

$ gem -v

如果gem版本小於2.6.x,則需要更新gem

2. 更新gem(gem版本高於2.6.x可跳過此步)

  1. 檢測ruby源,更新gem需要官方的ruby源
$ gem sources -l
$ gem sources --add https://rubygems.org/ --remove xxx.xxx
$ gem sources -l
  1. 更新gem(此步要翻牆)
$ gem update --system
  1. 檢視gem版本,確認大於2.6.x
$ gem -v
  1. 將ruby源切換回國內的
$ gem sources --add https://gems.ruby-china.com/
 --remove https://rubygems.org/
$ gem sources -l

3. 更新cocoapods

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