Error on pod install

送分小仙女□ 提交于 2019-11-27 10:01:21

If you landed here on or after January 30th 2014, there is a break in CocoaPods causing this. Please read the related blog post found here: http://blog.cocoapods.org/Repairing-Our-Broken-Specs-Repository/

or do:

pod repo remove master
pod setup

solved it on my own the trick was to use $sudo rm -rf ~/.cocoapods to clean the cocoapods master repo and then pod install worked without any problems.

hope this helps other people whom encountered this issue

The 100% dead-work one-line command is:

sudo rm -rf ~/.cocoapods && pod setup && pod install

I created the issue on GitHub traker:#2185

And the official answer is:

This is issue which has already been fixed by @irrationalfab with commit CocoaPods/CLAide@5e023ab. So the fix should be available in the next release of CocoaPods. Just be patient

If you need a clean master spec repo you can try

cd ~/.cocoapods/master
git reset --hard

or if you're on CocoaPods 0.23+, use ~/.cocoapods/repos/master.

You are going to have to manually delete any local copies of the Specs repository and re-clone the new version of the Specs repository. You can do that with the following commands: $ sudo rm -fr ~/.cocoapods/repos/master $ pod setup

when my projects get big and I have a large pod file, I run into this problem quite a bit.

My solution is as follows :

pod repo remove master
pod setup
pod install

You need to fix permissions and files owner

$ sudo chown -R user ~/Library/Caches/CocoaPods
$ sudo chown -R user ./Pods
$ sudo chown -R user ./Podfile.lock
$ sudo chmod -R 777 ./Pods

$ pod update/setup

Wow this one has been a real pain and everyone seems to have a different solution. For me this solution worked on multiple machines/environments on a few occasions:

Apparently there is a bug with psych that is causing the problem.

sudo gem uninstall psych
sudo gem install psych -v 2.0.0

There's a lengthy conversation over on the CococaPods repo about the issue and this fix.

Just to share my own fix for this issue:

Since this is a git issue, you can use simple git commands to resolve it (See @AdamSharp's post). What worked for me was running

git clean -d -f

in ~/.cocoapods/repos/master. This recursively removes any untracked files and directories from the repo. I encourage you to run:

git clean -d -f --dry-run

Before you actually execute anything so you can see what it would do. Should it break your CocoaPods master repo, simply delete ~/.cocoapods/repos/master and run pod repo update.

You can try it like this. pod spec lint --sources='https://git.oschina.net/yourname/jqcpodspec,https://github.com/CocoaPods/Specs' --allow-warnings --use-libraries

if your spec pass validation, then pod repo push JQCPodSpec FMCommonModelLib.podspec --sources='https://git.oschina.net/yourname/jqcpodspec,https://github.com/CocoaPods/Specs' --allow-warnings --use-libraries

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