cocoapods installation failed

Failed to install cocoapods

Failed to install cocoapods

1. Check for updates



2. Uninstall old cocoapods


After uninstalling, the terminal will show the following


1. cocoapods-1.3.1

2. cocoapods-1.4.0.beta.2

3. cocoapods-1.5.0

4. allversions


The terminal lists all cocoapods versions for you, you directly input the corresponding serial number at the end of the “>”, that is, to uninstall the version corresponding to the serial number, for example, if you input 1, it is to uninstall cocoapods-1.3.1, and if you input 4, it is to uninstall For example, if you enter 1, you are uninstalling cocoapods-1.3.1, and if you enter 4, you are uninstalling all versions.

3. Reinstall


If you have a mac before 10.11, type ” sudogeminstallcocoapods”

4. Terminal enter the following 2 commands


$sudoxcode- select-switch/Applications/

Note: In the 2nd command above, the path after -switch may be different for some people, so you go directly from your application and drag the Xcode subfile in the Developer directly from your application to the terminal

5. podsetup


After the success of this command, the terminal appears as follows