关于Cocoapods更新的问题

本文介绍了在iOS开发中遇到Cocoapods更新问题的解决过程,包括错误信息、Podfile内容展示,以及详细更新Cocoapods的步骤:更新gem,切换gem源,安装和设置Cocoapods,最后执行`pod update`成功解决问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在使用cocoapods的过程中,遇到了一个问题,就是在更新cocoapods的过程中,遇到一个问题,报错!大致如下;

Podfile文件如下:

platform:ios, ‘7.0’
pod ‘SDWebImage’, ‘~> 3.7.1’
pod ‘CocoaHTTPServer’, ‘~> 2.3’
pod ‘RoutingHTTPServer’, ‘~> 1.0.0’
pod ‘Masonry’, ‘~> 0.6.1’
pod ‘ASIHTTPRequest’, ‘~> 1.8.2’
pod ‘MBProgressHUD’, ‘~> 0.9.1’
pod ‘AFNetworking’, ‘~> 2.5.4’

在利用命令(首先切换到对项目所在目录)

pod install

的时候出现以下问题:

Update all pods
Analyzing dependencies

CocoaPods 0.39.0.beta.4 is available.
To update use: gem install cocoapods --pre
[!] This is a test version we’d love you to try.

For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.

Downloading dependencies
Installing AFNetworking (2.5.4)
Installing ASIHTTPRequest (1.8.2)
Installing CocoaAsyncSocket (7.4.2)
Installing CocoaHTTPServer (2.3)
Installing CocoaLumberjack (2.0.1)
Installing MBProgressHUD (0.9.1)
Installing Masonry (0.6.3)
Installing Reachability (3.2)
Installing RoutingHTTPServer (1.0.0)
Installing SDWebImage (3.7.3)
Generating Pods project
2015-09-23 13:18:31.468 ruby[1245:292388] [MT] DVTAssertions: ASSERTION FAILURE in /Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-8227/IDEFoundation/Initialization/IDEInitialization.m:590
Details: Assertion failed: _initializationCompletedSuccessfully
Function: BOOL IDEIsInitializedForUserInteraction()
Thread: {number = 1, name = main}
Hints: None
Backtrace:
0 0x0000000106998a5c -[DVTAssertionHandler handleFailureInFunction:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in DVTFoundation)
1 0x00000001069981e9 _DVTAssertionHandler (in DVTFoundation)
2 0x0000000106998455 _DVTAssertionFailureHandler (in DVTFoundation)
3 0x00000001069983b7 _DVTAssertionFailureHandler (in DVTFoundation)
4 0x0000000107e42f5c IDEIsInitializedForUserInteraction (in IDEFoundation)
5 0x000000010aa42eb9 +[PBXProject projectWithFile:errorHandler:readOnly:] (in DevToolsCore)
6 0x000000010aa44a3e +[PBXProject projectWithFile:errorHandler:] (in DevToolsCore)
7 0x00007fff91012f44 ffi_call_unix64 (in libffi.dylib)
Abort trap: 6
victordeiMac:swiftproject victor gemsourceslERROR:Invalidoption:sources.Seegemhelp.victordeiMac:swiftprojectvictor gem -version
ERROR: Invalid option: -version. See ‘gem –help’.

发现应该是版本的问题,进行更新
首先查看当前cocoapods版本的命令为:

pod –version

然后按照命令进行更新

$ sudo gem update –system // 先更新gem,国内需要切换源
$ gem sources –remove https://rubygems.org/
$ gem sources -a http://ruby.taobao.org/
$ gem sources -l

*** CURRENT SOURCES ***
http://ruby.taobao.org/

$ sudo gem install cocoapods // 安装cocoapods
$ pod setup

最后一步进行更新
通过如下命令进行操作:

pod update

Update all pods
Updating local specs repositories

CocoaPods 0.39.0.beta.4 is available.
To update use: gem install cocoapods --pre
[!] This is a test version we’d love you to try.

For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.

Analyzing dependencies
Downloading dependencies
Installing AFNetworking (2.5.4)
Installing ASIHTTPRequest (1.8.2)
Installing CocoaAsyncSocket (7.4.2)
Installing CocoaHTTPServer (2.3)
Installing CocoaLumberjack (2.0.1)
Installing MBProgressHUD (0.9.1)
Installing Masonry (0.6.3)
Installing Reachability (3.2)
Installing RoutingHTTPServer (1.0.0)
Installing SDWebImage (3.7.3)
Generating Pods project
Integrating client project

[!] Please close any current Xcode sessions and use swiftproject.xcworkspace for this project from now on.
Sending stats
Sending stats

至此,该问题解决了。

参考链接
http://www.cnblogs.com/brycezhang/p/3675670.html

http://code4app.com/article/cocoapods-install-usage

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值