美文网首页pod
cocoapods新坑 之ERROR: Could not f

cocoapods新坑 之ERROR: Could not f

作者: 31313_iOS | 来源:发表于2018-08-31 09:07 被阅读0次

cocoapods不知道为何,在pod安装第三方的时候找不到pod了。明明替换过了镜像了,还是提示这个错误。(其实这个错误基本就是镜像的错误,需要更换镜像了

提示的错误是: -bash: pod: command not found

赶紧的 pod --version

还是错误是: -bash: pod: command not found

想着可能是不小心被我删除了。于是准备重新下载

输入sudo gem install cocoapods

结果:

ERROR:  Could not find a valid gem 'cocoapods' (>= 0), here is why:
          Unable to download data from https://gems.ruby-china.org - bad response Not Found 404 (https://gems.ruby-china.org/specs.4.8.gz)

又输入:sudo gem install -n/usr/local/bin cocoapods最新的基本用这个命令安装

结果:

ERROR:  Could not find a valid gem 'cocoapods' (>= 0), here is why:
          Unable to download data from https://gems.ruby-china.org - bad response Not Found 404 (https://gems.ruby-china.org/specs.4.8.gz)

然后就直接一点,直接git上面下载:

git clone https://git.coding.net/CocoaPods/Specs.git ~/.cocoapods/repos/master
fatal: destination path '/Users/liguoliang/.cocoapods/repos/master' already exists and is not an empty directory.

卧槽,我的pod是存在的。就是用不了,what a fuck !

那就重新下载吧:

先移除(这里需要输密码):

sudo rm -rf ~/.cocoapods/

然后还是用git clone来下载。完成之后 pod --version 又是 -bash: pod: command not found妈的,这是个什么骚操作。到这里也不难发现我的这个也不是镜像的问题,因为我换过了。现在是:
https://gems.ruby-china.org
所以也是没有往这方面想。然后百度啊,都试过了。解决不了。。。各种博客,简述看到有链接的就点,就在快绝望的时候,妈的感觉看到了希望看到了一个Ruby china网站公告:

5267E8E5957703FC50181E51D08898F1.jpg

说是镜像.org因为域名备案的问题无法提供镜像服务,要.com代替.org.

赶紧替换镜像:

移除镜像gem sources --remove https://gems.ruby-china.org/

添加镜像 gem sources -a https://gems.ruby-china.com/

重新安装 sudo gem install -n/usr/local/bin cocoapods

这次不出意外,直接成功

在设置一下仓库:

pod setup

迫不及待的试了一下,你猜的没错,完美的解决!

相关文章

网友评论

    本文标题:cocoapods新坑 之ERROR: Could not f

    本文链接:https://www.haomeiwen.com/subject/hggrwftx.html