【发布时间】:2015-03-03 23:26:23
【问题描述】:
当尝试将新的Podfile pod install 插入现有 Xcode (iOS) 项目时,我从终端收到以下错误消息:[!] Unable to find a specification for 'XCDYouTubeKit (~> 2.1.1)'。我尝试加载的 Podfile 如下所示:
# Uncomment this line to define a global platform for your project
# platform :ios, '6.0'
target 'DemoApp' do
pod 'XCDYouTubeKit', '~> 2.1.1'
end
target 'DemoAppTests' do
end
target 'TheDayByDay' do
end
另外,我的Xcode项目的文件结构如下:
DemoApp
Podfile (file)
Pods (directory)
DemoApp (directory)
DemoApp.xcodeproj (file)
DemoAppTests (directory)
这个安装不工作怎么办?我哪里错了?我正在运行 Cocoapods 0.35.0。我错过了pod spec 文件吗?我不明白它是什么,也不明白这种文件的文件结构是什么样的。
【问题讨论】:
-
您可以尝试运行
pod repo update看看这个错误是否消失了吗?否则删除~/.cocoapods,然后运行pod setup -
@KeithSmiley
pod repo update不起作用,但我为什么要删除~/.cocoapods?那不就是整个 cocoa pods 安装库吗?这有什么帮助? -
@KeithSmiley pod repo update 实际上对我有用。它更新了我计算机中的大量其他存储库,您能解释一下为什么会这样吗?