1、首先去github上下載.zip文件:https://github.com/CocoaPods/Specs

20181123200316929.jpg
2、將下載的 master.zip 解壓出來,解壓后的文件目錄:

20181123201309668.jpg
3、將解壓出來的文件目錄復制到 /.cocoapods/repos/master 目錄:

20181123201827870.jpg
4、?然后cd到master目錄:
cd ~/.cocoapods/repos/master
5、初始化git:
git init
6、關(guān)聯(lián)倉庫:
git remote add origin https://github.com/CocoaPods/Specs
7、查看我們的repo是否正常,終端輸入:
pod repo

20181123202840152.jpg
8、?最后測試下 pod search 和 pod install,都可以正常使用了。