cocoapods 执行pod trunk push 报错CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Spec

今天发布ios sdk到cocoapods,最后执行pod trunk push时,出现了题目中的报错。

遗憾的时,查了一圈,都是让再podfile里加源,可是我是push啊,不是install和update啊,我没有podfile呀!咋办?

看到一个是在/etc/hosts中加   199.232.4.133 raw.githubusercontent.com   然而并没有什么卵用。

好吧,我决定卸载重新装了,步骤如下:

1.查一下rvm ,ruby是不是好好的。查能显示版本号就可以了。

(1)rvm -v   (2)ruby -v

2.查找cocoapods相关安装并卸载:

先查看本地安装过的cocopods相关东西,命令如下:

$ gem list --local | grep cocoapods

cocoapods 执行pod trunk push 报错CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Spec_第1张图片

然后逐个删除(如下示例):

$ sudo gem uninstall cocoapods-core

执行安装cocoapods的操作:

$ sudo gem install cocoapods

3.安装:

OS X 10.11以后系统的安装cocoapods 指令:$ sudo gem install -n /usr/local/bin cocoapods --pre

OS X 10.11之前系统的安装cocoapods 指令:$ sudo gem install cocoapods

安装完之后:

$ pod--version 可看到版本即可

4.我遇到一个问题:安装过程中报错ruby: pod No such file or directory   

    解决:参考https://blog.csdn.net/rpf2014/article/details/102790243  (务必使用文档中用的源https://gems.ruby-china.com,不然安装还是失败)

   原因:https://www.jianshu.com/p/eda1f500abf6

 

你可能感兴趣的:(cocoapods 执行pod trunk push 报错CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Spec)