How to downgrade or install an older version of Cocoapods

Viewed 253249

How can I downgrade Cocoapods to an older version, or how can I install an older version of Cocoapods?

8 Answers

Several notes:

Make sure you first get a list of all installed versions. I actually had the version I wanted to downgrade to already installed, but ended up uninstalling that as well. To see the list of all your versions do:

sudo gem list cocoapods

Then when you want to delete a version, specify that version.

sudo gem uninstall cocoapods -v 1.6.2

You could remove the version specifier -v 1.6.2 and that would delete all versions:

You may try all this and still see that the Cocoapods you expected is still installed. If that's the case then it might be because Cocoaposa is stored in a different directory.

sudo gem uninstall -n /usr/local/bin cocoapods -v 1.6.2

Then you will have to also install it in a different directory, otherwise you may get an error saying You don't have write permissions for the /usr/bin directory

sudo gem install -n /usr/local/bin cocoapods -v 1.6.1

To check which version is your default do:

pod --version

For more on the directory problem see here

In my case I had to uninstall from homebrew

brew uninstall cocoapods

In some cases, one needs to remove some hidden artefacts in the home directory so that the up- or downgrade takes effect:

rm -rf ~/.cocoapods
Related