通过pod --version可以查看当前pod的版本 我的是0.38.2 此时0.39.0已经可以安装了 今晚就来安装一下最新的pods
如果只是在终端里执行sudo gem install cocoapods 也仍然会报错 Unable to download from http://ruby.taobao.org/ -bad response not found404
这是什么原因呢 通过查找得知 虽然我把亚马逊的镜像换成了国内淘宝的 但是由于淘宝将http升级成了https 所以我们只有跟着升级,详情:博客分享->点击打开链接 官网说明:淘宝官方->点击打开链接
我们需要将http换成https 执行以下代码:
gem sources --add https://ruby.taobao.org/ --remove http://ruby.taobao.org/
但是我在执行完后发现 还是会有错误,提示:
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /Users/love/.gemrc
使用open /Users/love 命令 来到这个文件夹下 找到.gemrc文件 执行->显示简介->更改权限 改成读与写
然后我们再执行
gem sources --add https://ruby.taobao.org/ --remove http://ruby.taobao.org/
https://ruby.taobao.org/ added to sources
http://ruby.taobao.org/ removed from sources
我们gem sources -l查看一下 发现出来的是:*** CURRENT SOURCES ***
https://ruby.taobao.org/
可以看到 到这里 我们已经成功的将http换成了https的我们再执行一下sudo gem install cocoapods 发现会要求我们输入密码 然后就是出来一大段安装的信息->
Fetching: nap-1.0.0.gem (100%)
Successfully installed nap-1.0.0
Fetching: cocoapods-core-0.39.0.gem (100%)
Successfully installed cocoapods-core-0.39.0
Fetching: xcodeproj-0.28.2.gem (100%)
Successfully installed xcodeproj-0.28.2
Fetching: cocoapods-search-0.1.0.gem (100%)
Successfully installed cocoapods-search-0.1.0
Fetching: cocoapods-stats-0.6.2.gem (100%)
Successfully installed cocoapods-stats-0.6.2
Fetching: cocoapods-try-0.5.1.gem (100%)
Successfully installed cocoapods-try-0.5.1
Fetching: molinillo-0.4.0.gem (100%)
Successfully installed molinillo-0.4.0
Fetching: cocoapods-0.39.0.gem (100%)
cocoapods's executable "pod" conflicts with /usr/local/bin/pod
Overwrite the executable? [yN] y
Successfully installed cocoapods-0.39.0
Parsing documentation for nap-1.0.0
Installing ri documentation for nap-1.0.0
Parsing documentation for cocoapods-core-0.39.0
Installing ri documentation for cocoapods-core-0.39.0
Parsing documentation for xcodeproj-0.28.2
Installing ri documentation for xcodeproj-0.28.2
Parsing documentation for cocoapods-search-0.1.0
Installing ri documentation for cocoapods-search-0.1.0
Parsing documentation for cocoapods-stats-0.6.2
Installing ri documentation for cocoapods-stats-0.6.2
Parsing documentation for cocoapods-try-0.5.1
Installing ri documentation for cocoapods-try-0.5.1
Parsing documentation for molinillo-0.4.0
Installing ri documentation for molinillo-0.4.0
Parsing documentation for cocoapods-0.39.0
Installing ri documentation for cocoapods-0.39.0
8 gems installed
到这里我们再看一下pod的版本 -> pod --version
可以看到 现在已经是0.39.0也就是最新版本了 OK完成