1. Run the following command to delete the RVM. After the local RVM is deleted, run the RVM -v command, and a number of RVM error messages are displayed. All you need to do is close the terminal and turn it back on

    Note: After removing the RVM, you need to close the terminal session or shell session to completely clean up all RVM-related environment variables and Settings.Copy the code

    Restart the terminal

    $RVM -v (ZSH: command not found: RVM deleted successfully)Copy the code
  2. Uninstall the old version of Cocopods and run the following command. Multiple versions of Cocoapods may appear. You can delete cocoapods one by one or all of them

    $ sudo gem uninstall cocoapods
    Copy the code
  3. Run the following command to remove the global cache:

    $ sudo rm -fr ~/Library/Caches/CocoaPods/
    Copy the code
  4. View locally installed Cocopods

    $ gem list --local | grep cocoapods
    Copy the code

    The results are shown in Figure 1:

    Then run commands to delete them one by one

    $ sudo gem uninstall cocoapods-core
    
    $ sudo gem uninstall cocoapods-deintegrate
    Copy the code
  5. Install CocoaPods, default you here of the brew and ruby has been installed (without installation can go to the www.jianshu.com/p/b24ddfb84… Install cocoapods before OS X 10.11:

    $ sudo gem install cocoapods
    Copy the code

    Install cocoapods after OS X 10.11

    $ sudo gem install -n /usr/local/bin cocoapods
    Copy the code
  6. That’s the worst part. It took almost a day. After reinstalling cocoapods, Cloning Spec repo appears after pod Install or POD Updatecocoapods from https://github.com/CocoaPods/Specs.gitStuck condition, as shown in Figure 2:

It’s not actually stuck, it’s just that the spec repo is downloading because of the slow connectioncocoapodsIt’s slow and feels like it’s stuck. If you go to your system’s Activity Monitor and look at the Network section, you will see that something is being downloaded. There is a git-remote-http for downloading the Spec repococoapodsSo take your time!