cocopods 1.1.1更新失败

pod update
//错误
Updating local specs repositories
[!] The `master` repo requires CocoaPods 1.0.0 -  (currently using 0.39.0)
Update CocoaPods, or checkout the appropriate tag in the repo.

于是更新cocopods

sudo gem install cocoapods
//依旧失败
ERROR:  While executing gem ... (Errno::EPERM)
    Operation not permitted - /usr/bin/xcodeproj

猜测是gem版本太低,于是继续

sudo gem update --system
//还是失败
Updating rubygems-update
Fetching: rubygems-update-2.6.8.gem (100%)
ERROR:  While executing gem ... (Errno::EPERM)
    Operation not permitted - /usr/bin/update_rubygems

查看了一下gem的版本

gem -v
2.6.1

从网上寻找解决办法

sudo gem install -n /usr/local/bin cocoapods
//显示如下
Successfully installed xcodeproj-1.4.1
Fetching: molinillo-0.5.4.gem (100%)
Successfully installed molinillo-0.5.4
Fetching: gh_inspector-1.0.2.gem (100%)
....省略好多行

再次执行

pod update
//失败
Performing a deep fetch of the `master` specs repo to improve future performance
[!] /usr/bin/git -C /Users/jing/.cocoapods/repos/master fetch --unshallow

error: RPC failed; curl 56 SSLRead() return error -9806
fatal: The remote end hung up unexpectedly

然后执行

pod repo update --verbose
//显示如下
$ /usr/bin/git -C /Users/jing/.cocoapods/repos/master pull --ff-only
  From https://github.com/CocoaPods/Specs
     544d169..d362e91  master     -> origin/master
  Updating c479d4f..d362e91
......
CocoaPods 1.2.0.beta.1 is available.
To update use: `sudo gem install cocoapods --pre`
[!] This is a test version we'd love you to try.

For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.2.0.beta.1

然后

pod update
//错误如下
[!] The dependency `xxxx` is not used in any concrete target.
The dependency `xxxx` is not used in any concrete target.The The dependency `xxxx` is not used in any concrete target.
The dependency `xxxx` is not used in any concrete target.

解决方法如下://加上target:
将Podfile中的代码改成如下形式即可。

platform :ios, '8.0'
use_frameworks!
target 'MyApp' do
pod 'AFNetworking', '~> 2.6'
pod 'ORStackView', '~> 3.0'
pod 'SwiftyJSON', '~> 2.3'
end
备注:另外,可以通过pod init命令在工程文件夹下生成一个默认的Podfile文件。

更改完成后

pod repo update --verbose
pod update
//显示如下(成功)
Analyzing dependencies
Downloading dependencies
Installing AFNetworking (3.1.0)
Installing ........
Sending stats
Pod installation complete! There are 14 dependencies from the Podfile and 15 total pods installed.

成功。。。。

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

推荐阅读更多精彩内容

  • CocoaPods 是什么? CocoaPods 是一个负责管理 iOS 项目中第三方开源库的工具。CocoaPo...
    朝洋阅读 25,859评论 3 50
  • 项目组件化、平台化是技术公司的共同目标,越来越多的技术公司推崇使用pod管理第三方库以及私有组件,一方面使项目架构...
    swu_luo阅读 22,698评论 0 39
  • Ruby 安装 要安装cocospods 首先需要安装ruby,可以先安装xcode,再安装macport ,最后...
    山天大畜阅读 6,012评论 0 1
  • 2017年3月15日,重庆,几座“男用英式公厕”亮相洋人街景区路边。 这些供男士小便专用的露天公厕,每座有4个站位...
    印象智慧游阅读 4,231评论 0 0
  • 下午满怀期待地去见老板,结果被训得体无完肤。他听到我的问题后,发了很大的火,我真觉得自己是个弱智。 一出门,眼泪就...
    敬哥阅读 1,722评论 0 0