Mac OS 10.11, some cocoapods commands to change. If you have a pod setup or pod update problem, and it is difficult to solve, I suggest 10.11. Uninstall reinstall after installation of cocoapods has some different commands, the following summary:
1 。check the ruby environment, if necessary, please update as follows
$ sudo gem update --system
2 。uninstall cocoapods
$ sudo gem uninstall cocoapods
3 。reinstall cocoapods (Setup command has changed)
Before 10.11
$ sudo gem install cocoapods
After 10.11
$ sudo gem install -n /usr/local/bin cocoapods
4
$ sudo chmod +rx /usr/local/bin
$ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
//taking CocoaPods Specs repository copy to your computer under directory ~/.cocoapods
5 。pod setup
setup过程中如果出现 error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54错误,就执行 $ git clone https://git.coding.net/CocoaPods/Specs.git ~/.cocoapods/repos/master 命令应该就可以了。
版本回退:
1.查看版本号:git reflog
2.回退到指定版本:git reset --hard 指定版本号(例:git reset --hard 3628164)