Error when running pod install

风格不统一 提交于 2019-12-23 08:49:40

问题


When I run the pod install command, I am getting the following error:

[!] The `master` repo requires CocoaPods 1.0.0 -  (currently using 0.39.0)
Update Cocoapods, or checkout the appropriate tag in the repo.

Updating is not an option for me currently.

I looked at the answers to this question but none of the solutions seemed to work for me.

How can I continue to use CocoaPods 0.39.0 for my dependency management?


回答1:


Cocoapods had an issue with rate limiting back in March and implemented sharding to avoid this problem in the future. There's a blog post here about it.

To fix this, you can either update to a 1.x version of Cocoapods or add the new source to the top of your Podfile:

source "https://github.com/CocoaPods/Old-Specs"

You probably will need to replace the other source line.


If you continue having issues, it's likely because a specific pod does not have a spec accessible in the source you're now using. I ran into this issue with the Apptentive SDK. You can specify the source for an individual library in your Podfile likeso:

pod 'apptentive-ios', :git => 'https://github.com/apptentive/apptentive-ios.git', :tag => 'v3.0.0'

Simply update :git and :tag with the correct values.

For a Github project, it may be easiest to go through the Releases page of whatever library you're looking at to find the tag you want for a specific version.




回答2:


Write following command in terminal

sudo gem install -n /usr/local/bin cocoapods



回答3:


At first In Podfile replace source "https://github.com/CocoaPods/Specs" with "source "https://github.com/CocoaPods/Old-Specs"

Move to your workspace root folder by below command :

cd <path to your workspace>

Pod install

If it doesn't work well then try above steps after following below steps.

In Terminal follow these steps :

gem list --local | grep cocoapods

You see output similar to this:

cocoapods (0.27.1, 0.20.2)
cocoapods-core (0.27.1, 0.20.2)
cocoapods-downloader (0.2.0, 0.1.2)

now for a safer side delete all local pods using below command :

sudo gem uninstall cocoapods
sudo gem uninstall cocoapods-core
sudo gem uninstall cocoapods-downloader

safer side delete cocoa pods version 0.39.0

sudo gem uninstall cocoapods -v 0.39.0

reinstall cocoa pods version 0.39.0

sudo gem install cocoapods -v 0.39.0

Then run below commands in terminal :

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

Move to your workspace root folder by below command :

cd <path to your workspace>

run below commands :

rm -rf Pods
rm -rf Podfile.lock
pod install (this time you should be able to see it working)



回答4:


Hi I tried above all answers, But nothing got working, Finally I tried these Steps in Terminal.

1- Open Terminal
2- cd < Your Project File Location>
3- sudo gem install cocoapods --pre
4- pod setup
5- touch podfile
6- pod install


来源:https://stackoverflow.com/questions/40557449/error-when-running-pod-install

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!