6

每当我尝试安装任何 Google 的 cocoapods 时,都会遇到两个错误之一。

任何一个:

$ pod install
Analyzing dependencies
[!] The version of CocoaPods used to generate the lockfile (0.38.0.beta.2) is higher than the version of the current executable (0.37.2). Incompatibility issues may arise.

CocoaPods 0.38.0.beta.2 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 Google (1.0.7)

[!] Error installing Google

...

inflating: /var/folders/<myDirectory>/Samples/signin/SignInExampleSwift/ViewController.swift  
warning [/var/folders/<myDirectory>/file.zip]:  375 extra bytes at beginning or within zipfile

(attempting to process anyway)

或者:

$ pod install
[in /Users/<user>/Desktop/FakeProject]
Analyzing dependencies

CocoaPods 0.38.0.beta.2 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 AppInvites (1.0.1)

[!] Error installing AppInvites
[!] /usr/bin/tar xfz /var/folders/<myDirectory>/file.tgz -C /var/folders/<myDirectory>

tar: Unrecognized archive format

tar: Error exit delayed from previous errors.

我一直在尝试使用新的和现有的 Objective-C 项目,并尝试卸载和重新安装 cocoapods。不太确定问题似乎是什么,谷歌没有针对他们的 cocoapods 进行任何故障排除。

4

4 回答 4

21

尝试更新您的宝石

sudo gem update -n /usr/local/bin cocoapods
pod install
于 2016-06-09T06:14:27.963 回答
1

删除 podfile.lock 并pod install为我修复它。

于 2018-05-09T06:39:01.173 回答
0

我有同样的问题,我先做了gem install cocoapods然后pod install工作正常。

于 2018-04-11T11:33:54.413 回答
-1

6小时后我发现了这个

访问http://cocoapods.org/并下载 tar 文件

于 2018-07-06T02:51:19.883 回答