mac 系统升级后 Cocoapods1.8.4 pod指令失效

系统版本: macOS High Sierra 10.14.6
Xcode: 9.2 ——>11.3

每次系统升级,cocoapods 都是一个坑 ,出各种问题,这次cocoapods 1.8.4 就一大堆问题,在网上搜了好多方法最后下面的方法才解决我的问题

dos命令:

//进入repos 目录
$  cd ~/.cocoapods/repos 

//删除master
$  pod repo remove master

//删除trunk
seasondeMacBook-Pro:repos 用户名$  pod repo remove trunk

//下载Specs.git  
$ git clone https://github.com/CocoaPods/Specs.git
//或者  

$ git clone https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git master

下载完成后,Podfile 文件可以这样的写

source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git'

platform :ios,'9.0'

target 'Test' do
    pod 'Reachability'
    pod 'MBProgressHUD'
    pod 'SDWebImage'
    pod 'YYKit'
    pod 'Toast'
    pod 'FMDB'
    pod 'JSPatch'
    pod 'AFNetworking'
    pod 'JSONModel'
    pod 'Realm'
end

或者这样写

source 'https://github.com/CocoaPods/Specs.git'
platform :ios,'9.0'

target 'Test' do
    pod 'Reachability'
    pod 'MBProgressHUD'
    pod 'SDWebImage'
    pod 'YYKit'
    pod 'Toast'
    pod 'FMDB'
    pod 'JSPatch'
    pod 'AFNetworking'
    pod 'JSONModel'
    pod 'Realm'
end

前提是Podfile 的source 你下载成功了,可以这样写

pod 命令 就可以执行成功啦!

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容