Error on pod install

后端 未结 10 1961
南笙
南笙 2020-11-30 17:03

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

相关标签:
10条回答
  • 2020-11-30 17:14

    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.

    0 讨论(0)
  • 2020-11-30 17:16

    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

    0 讨论(0)
  • 2020-11-30 17:19

    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.

    0 讨论(0)
  • 2020-11-30 17:20

    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
    
    0 讨论(0)
  • 2020-11-30 17:32

    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

    0 讨论(0)
  • 2020-11-30 17:32

    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

    0 讨论(0)
提交回复
热议问题