当我运行pod install
命令时,会得到以下错误:
[!] The `master` repo requires CocoaPods 1.0.0 - (currently using 0.39.0)
Update Cocoapods, or checkout the appropriate tag in the repo.
更新目前对我来说不是一个选项。
我看了这个问题的答案,但似乎没有一个解决方案对我有用。
如何继续使用CocoaPods 0.39.0进行依赖关系管理?
发布于 2016-11-11 22:57:05
Cocoapods在三月份就有一个限制利率的问题,为了避免将来出现这个问题,Cocoapods实施了分片。有一篇关于这件事的博客文章这里。
要解决这个问题,您可以更新到Cocoapods的1.x版本,也可以将新的源代码添加到Podfile的顶部:
source "https://github.com/CocoaPods/Old-Specs"
您可能需要用替换另一个源行。
如果您继续出现问题,很可能是因为某个特定的吊舱在您现在使用的源中没有可访问的规范。我和应用SDK碰到了这个问题。您可以在Podfile likeso中指定单个库的源:
pod 'apptentive-ios', :git => 'https://github.com/apptentive/apptentive-ios.git', :tag => 'v3.0.0'
只需使用正确的值更新:git
和:tag
。
对于Github项目,通过查看任何库的发布版本页面查找特定版本的标记可能是最简单的。
发布于 2016-11-16 19:30:34
首先,在Podfile中,将源"https://github.com/CocoaPods/Specs“替换为”https://github.com/CocoaPods/Old-Specs源“
通过以下命令移动到工作区根文件夹:
cd <path to your workspace>
Pod install
如果它不能很好地工作,那么在下面的步骤之后尝试上面的步骤。
在终端中,请执行以下步骤:
gem list --local | grep cocoapods
您可以看到类似于以下内容的输出:
cocoapods (0.27.1, 0.20.2)
cocoapods-core (0.27.1, 0.20.2)
cocoapods-downloader (0.2.0, 0.1.2)
现在,为了更安全起见,请使用以下命令删除所有本地吊舱:
sudo gem uninstall cocoapods
sudo gem uninstall cocoapods-core
sudo gem uninstall cocoapods-downloader
安全侧删除可可荚版本0.39.0
sudo gem uninstall cocoapods -v 0.39.0
重新安装可可荚版本0.39.0
sudo gem install cocoapods -v 0.39.0
然后在终端中运行以下命令:
cd <path to your workspace>
pod install (this time it would fail again, but that's fine)
cd ~/.cocoapods/repos
git clone https://github.com/CocoaPods/Specs.git
cd specs
git checkout v0.32.1
通过以下命令移动到工作区根文件夹:
cd <path to your workspace>
运行以下命令:
rm -rf Pods
rm -rf Podfile.lock
pod install (this time you should be able to see it working)
发布于 2016-12-06 09:45:22
在终端中写入以下命令
sudo gem install -n /usr/local/bin cocoapods
https://stackoverflow.com/questions/40557449
复制相似问题