I have a working project the uses a pod file for some weeks now. When I learned that some of my pods have update I tried to \'pod install\' on got this weird error
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
.
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
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
.
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
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
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