If you need to downgrade or install an older version of Cocoapods, follow below step.
Here's how you can downgrade or install an older version of Cocoapods:
sudo gem uninstall cocoapods
.sudo gem install cocoapods -v VERSION_NUMBER
, where VERSION_NUMBER is the version you want to install.source 'https://rubygems.org'
gem 'cocoapods', '~> VERSION_NUMBER'
Replace VERSION_NUMBER with the specific version you want to use.
Then, run bundle install
to install the Cocoapods version specified in the Gemfile.
Firstly, I updated my Ruby version using the following command:
rvm install ruby-2.7
Use the specific version of Ruby as per your macOS compatibility.
After updating Ruby, I ran CocoaPods again, which installed version 1.10.1. However, Homebrew only allowed installing version 1.10.1.
In my case, I resolved this issue by updating Ruby to version 2.7 in order to install CocoaPods version 1.10.0.
To downgrade the Cocoapods version using brew, you may encounter this requirement due to compatibility issues with your project or dependencies.
Here's how you can downgrade Cocoapods version using brew:
brew uninstall cocoapods
brew tap homebrew/core
brew install cocoapods@VERSION_NUMBER
Replace VERSION_NUMBER with the specific version you want to install. For example, if you want to install version 1.9.0:
brew install [email protected]
After installation, you can verify the Cocoapods version by running:
cocoapods --version
I uninstalled CocoaPods using brew uninstall cocoapods
, then reinstalled it using sudo gem install cocoapods
, and it worked.
To install a specific version of Cocoapods using Homebrew try below step.
Here's how you can install a specific version of Cocoapods using Homebrew:
brew tap homebrew/cask-versions
brew install cocoapods@VERSION_NUMBER
Enter your VERSION_NUMBER with the specific version you want to install. For example, if you want to install version 1.9.0:
brew install [email protected]
After installation, you can verify the Cocoapods version by running:
cocoapods --version
I was also facing the same issue. When I ran brew upgrade cocoapods
, it showed "Warning: cocoapods 1.11.2_2 already installed." So, I uninstalled CocoaPods with brew uninstall cocoapods
, and then installed it again using brew install cocoapods
. Now, pod --version
shows 1.11.3.
To remove your current version of CocoaPods, you could just run:
sudo gem uninstall cocoapods
To install a specific version of CocoaPods, you can use the following command:
sudo gem install cocoapods -v 0.20.0
You can use older installed versions with the following command:
pod _0.20.0_ setup
To downgrade the Cocoapods version on your Mac.
Here's how you can downgrade the Cocoapods version on your Mac:
sudo gem uninstall cocoapods
sudo gem install cocoapods -v VERSION_NUMBER
VERSION_NUMBER with the specific version you want to install. For example, if you want to install version 1.9.0:
sudo gem install cocoapods -v 1.9.0
After installation, you can verify the Cocoapods version by running:
cocoapods --version
To install a specific version, you can use the following command as an example:
sudo gem install cocoapods -v 0.30.0
Alternatively, you can uninstall all versions to ensure only the latest version is available.
Afterwards, you can install CocoaPods again using the command:
sudo gem install cocoapods