1、找到要切换的xcode版本的路径
2、切换xcode路径的方法为:sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer(xcode路径)
3、查看切换后的xcode版本路径:
xcode-select -print-path
1.可以通过 gem list --local | grep cocoapods
命令查看我们电脑上安装了哪些版本的 CocoaPods,并通过 pod --version
查看系统默认使用的那个版本。:https://www.meiwen.com.cn/subject/vjxphqtx.html
2.删除某个版本:sudo gem uninstall cocoapods 1.9.1
3.安装指定版本:sudo gem install cocoapods -v 1.4.0
4 pod 查看当前源:
1).进入当前原:cd ~/.cocoapods/repos
2).pod 查看当前源:pod repo 或者 pod repo list
pod repo换源:
(修改 repo 的 master)
cd ~/.cocoapods/repos
(git clone https://github.com/CocoaPods/Specs.git ~/.cocoapods/repos/master 切换github为master)
$ pod repo remove master
$ git clone https://git.coding.net/CocoaPods/Specs.git ~/.cocoapods/repos/master
$ pod repo update
5.如果快速跳过 pod update 的时候去 更新 master repo : https://www.jianshu.com/p/532440b02c8a
解决方案是 pod update 分两步
1),只跟新指定 repo 比如:pod repo update somerepo, 就只更新 somerepo 这一个 repo
2),pod update —no-repo-update
6.git报错--RPC failed; curl 18 transfer closed with outstanding read data remaining
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
解决方法: git config --global http.postBuffer 524288000
参看文献:https://www.cnblogs.com/dengxiaoning/p/11681272.html
7.
$ gem sources --remove https://rubygems.org/ # 移除默认源
$ gem sources -a https://gems.ruby-china.org/ # 添加Ruby China镜像
$ gem sources -l
8.cocoapods 无法连接github:https://www.jianshu.com/p/f54ce308dc35
9.快速更新Cocoapods/specs:
https://www.jianshu.com/p/b4af41fde73b,
https://www.cnblogs.com/gchlcc/p/6068801.html
10彻底解决GitHub被墙,Cocoapods和Homebrew无法使用问题:
https://www.jianshu.com/p/6e76f6b455db
11.修改host 文件:sudo vim /etc/hosts