Question
How can I install an older version of CocoaPods, or downgrade CocoaPods to a previous version?
For example, if a project requires a specific CocoaPods release, what commands should I use to:
- install that older version,
- verify which version is active, and
- use the correct version reliably for the project?
Short Answer
By the end of this page, you will understand how Ruby gem versioning works for CocoaPods, how to install a specific CocoaPods version, how to run that exact version, and how teams usually keep CocoaPods versions consistent across projects.
Concept
CocoaPods is distributed as a Ruby gem, so installing or downgrading it means working with Ruby's gem version system.
When people say they want to downgrade CocoaPods, they usually mean one of these things:
- install an older gem version,
- make that older version the one they use in the terminal,
- or ensure a project always runs a specific version.
The key idea is that multiple gem versions can exist on the same machine. You do not always have to remove the newer one first. Instead, you can install a specific version and then run that exact version when needed.
This matters because many iOS projects depend on tool versions being consistent. A different CocoaPods version can sometimes change:
- lockfile format,
- dependency resolution behavior,
- generated project files,
- warnings or build behavior.
So the real skill is not just installing an old version once. It is understanding how to pin and use the correct version intentionally.
Mental Model
Think of CocoaPods like a tool in a toolbox, and each version is a different edition of the same tool.
1.15.2is one edition1.14.3is another edition1.13.0is another edition
Installing an older version does not necessarily throw the newer one away. It is more like putting another edition into the toolbox.
The important part is choosing which edition you actually pick up and use.
Ruby gems let you:
- keep multiple versions installed,
- ask for one exact version,
- and verify which one is being used.
For project work, this is similar to saying: "Use this exact screwdriver for this exact job."
Syntax and Examples
The most common way to install a specific CocoaPods version is with gem install and the -v flag.
gem install cocoapods -v 1.14.3
This tells RubyGems to install exactly version 1.14.3 of the cocoapods gem.
To check installed versions:
gem list cocoapods
Example output:
*** LOCAL GEMS ***
cocoapods (1.15.2, 1.14.3)
To check which CocoaPods version runs by default:
pod --version
If you want to run a specific installed version explicitly, use gem's version execution through Bundler-friendly patterns or direct versioned invocation in Ruby environments. A common reliable team approach is to use a Gemfile:
source "https://rubygems.org"
gem "cocoapods", "1.14.3"
Then install and run it with Bundler:
bundle install
bundle pod --version
bundle pod install
Step by Step Execution
Consider this command:
gem install cocoapods -v 1.14.3
Here is what happens step by step:
gem installtells RubyGems to install a package.cocoapodsis the gem name.-v 1.14.3means only version1.14.3is acceptable.- RubyGems downloads that version and its dependencies.
- The gem becomes available in your Ruby environment.
Now suppose you run:
gem list cocoapods
RubyGems checks locally installed gems and prints the CocoaPods versions it finds.
Next, if you run:
pod --version
Your shell runs the pod executable it finds first in the current Ruby setup and PATH. This is why installing an older version is not always enough by itself: the shell may still use a different version.
That is why this project-level pattern is often safer:
source "https://rubygems.org"
gem "cocoapods", "1.14.3"
Then:
Real World Use Cases
Using an older CocoaPods version is common in real development.
Working on an older iOS app
A legacy app may have been last maintained with a specific CocoaPods version. Using a newer one might change the Podfile.lock or generate different project settings.
Matching a CI environment
A continuous integration server may still use an older version. To avoid "works on my machine" issues, developers install and run the same version locally.
Reproducing a bug
If a problem appeared after upgrading CocoaPods, installing the previous version helps confirm whether the upgrade caused it.
Supporting multiple projects
You might work on:
- one app that needs
1.11.x - another that needs
1.14.x - a new app using the latest version
Instead of constantly uninstalling and reinstalling globally, you can keep multiple versions and use Bundler per project.
Team onboarding
New developers can clone a project, run bundle install, and immediately get the expected CocoaPods version without guessing.
Real Codebase Usage
In real codebases, developers usually avoid relying on a random global CocoaPods installation.
Common patterns include:
Pinning the version with Bundler
A Gemfile is the most common and safest approach.
source "https://rubygems.org"
gem "cocoapods", "1.14.3"
Then commands are run as:
bundle exec pod install
bundle exec pod update
Version consistency in CI
CI pipelines often run:
bundle install
bundle exec pod install
This prevents unexpected failures from machine-specific gem versions.
Guarding setup with documentation
Projects often include setup instructions like:
bundle install
bundle exec pod install
instead of simply telling developers to run pod install.
Early validation
Developers may check the active version before debugging dependency issues:
Common Mistakes
Here are common mistakes beginners make when trying to downgrade CocoaPods.
Mistake 1: Installing an older version and assuming it becomes active automatically
Broken expectation:
gem install cocoapods -v 1.14.3
pod --version
# still shows 1.15.2
Why it happens:
- another installed version is still being used by your shell,
- or your Ruby environment is not the one you think it is.
How to avoid it:
- check installed versions with
gem list cocoapods - use a
Gemfile - run
bundle exec pod --version
Mistake 2: Uninstalling everything unnecessarily
Broken approach:
gem uninstall cocoapods
This can remove versions you still need for other projects.
Better approach:
gem uninstall cocoapods -v 1.15.2
Remove only the version you no longer want.
Mistake 3: Confusing CocoaPods version with pod dependencies
Beginners sometimes think this command changes dependency versions:
gem install cocoapods -v 1.14.3
Comparisons
Here is how the main approaches compare.
| Approach | What it does | Best for | Downsides |
|---|---|---|---|
gem install cocoapods -v x.y.z | Installs a specific global gem version | Quick local setup | May not guarantee project uses that version |
gem uninstall cocoapods -v x.y.z | Removes one installed version | Cleaning up versions | Can break old projects if removed carelessly |
pod --version | Shows active pod version | Quick verification | Only shows current executable, not all installed versions |
gem list cocoapods | Shows installed versions | Auditing local setup | Does not tell you which one a project will use |
Cheat Sheet
# Install a specific CocoaPods version
gem install cocoapods -v 1.14.3
# List installed CocoaPods versions
gem list cocoapods
# Check active pod version
pod --version
# Uninstall one specific version
gem uninstall cocoapods -v 1.15.2
# Gemfile
source "https://rubygems.org"
gem "cocoapods", "1.14.3"
# Install gems from Gemfile
bundle install
# Run the pinned CocoaPods version
bundle exec pod --version
bundle exec pod install
Key rules
- CocoaPods is a Ruby gem.
-vinstalls an exact version.- Multiple versions can be installed at once.
pod --versionshows the active version, not all installed versions.Gemfile+bundle execis the safest project workflow.
Useful checks
which ruby
which gem
which pod
ruby -v
gem -v
FAQ
How do I install a specific CocoaPods version?
Use:
gem install cocoapods -v 1.14.3
Replace 1.14.3 with the version you need.
How do I downgrade CocoaPods to an older version?
Install the older version first. If needed, uninstall the newer one or use Bundler so your project runs the exact version you want.
Can I have multiple CocoaPods versions installed at the same time?
Yes. RubyGems allows multiple installed versions of the same gem.
Why does pod --version still show the newer version after I install an older one?
Because your shell may still be using a different installed executable or Ruby environment. Use gem list cocoapods and prefer bundle exec pod --version in a project.
What is the safest way to use an older CocoaPods version in a team project?
Create a Gemfile, pin the CocoaPods version there, run bundle install, and use bundle exec pod install.
Does changing the CocoaPods version change the pods in my Podfile?
No. It changes the CocoaPods tool version, not the dependency versions listed in your project.
Should I uninstall the latest CocoaPods version before installing an older one?
Mini Project
Description
Create a small setup for an iOS project that always uses a specific CocoaPods version. This demonstrates how to avoid global-version confusion and make local development match CI or teammates' machines.
Goal
Pin CocoaPods to one exact version and run pod through Bundler so the project uses the expected tool version every time.
Requirements
- Create a
Gemfilefor the project. - Pin CocoaPods to a specific version.
- Install the gems with Bundler.
- Verify the pinned CocoaPods version.
- Run a CocoaPods command through Bundler.
Keep learning
Related questions
Calling a Class Method from an Instance in Ruby
Learn how to call a class method from an instance in Ruby using self.class, with examples, pitfalls, and practical usage patterns.
Calling an Overridden Monkey-Patched Method in Ruby
Learn how to call the original method when monkey patching in Ruby, including alias_method patterns, examples, pitfalls, and practical usage.
Convert a Unix Timestamp to Ruby DateTime
Learn how to convert Unix timestamps to Ruby DateTime and Time objects, with examples, differences, pitfalls, and practical Ruby usage.