Skip to content

Instantly share code, notes, and snippets.

@monkeymonk
Forked from derekli66/Reinstall_Cocoapods
Last active August 10, 2018 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save monkeymonk/54b283f48a444a5be563833d5bca1b07 to your computer and use it in GitHub Desktop.
Save monkeymonk/54b283f48a444a5be563833d5bca1b07 to your computer and use it in GitHub Desktop.
Reinstall Cocoapods
#!/bin/bash
# When pod install or pod update gets hanged at "Analyzing dependencies", please consider to reinstall cocoapods.
# 1. Uninstallation
# Reference: http://superuser.com/questions/686317/how-to-fully-uninstall-the-cocoapods-from-the-mac-machine
for x in `gem list --no-versions | grep cocoapods`; do gem uninstall $x -a -x -I; done
# 2. Reinstall cocoapods
sudo gem install cocoapods
# 3. Repairing broken specs
# Reference: http://blog.cocoapods.org/Repairing-Our-Broken-Specs-Repository/
sudo rm -fr ~/.cocoapods/repos/master
pod setup
# 4. After setup and edit your Podfile
pod install
# 5. Force update pods
pod update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment