首先在 Podfile 中将 source "https://github.com/CocoaPods/Specs" 替换为 "source "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)
现在为了更安全,请使用以下命令删除所有本地 pod:
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
重新安装 cocoa pods 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)