Pod: command not found (bash or zsh): how to fix CocoaPods
Codemia Knowledge Hub ·
pod: command not found means your shell cannot find the CocoaPods pod command. Either CocoaPods is not installed, its install location is not on your PATH, or the Ruby environment it depends on is broken. Check Ruby, install CocoaPods with gem, make sure its directory is on PATH, then confirm with pod --version.
CocoaPods is a widely used dependency manager for iOS development that simplifies integrating third-party libraries. The message reads -bash: pod: command not found in Bash and zsh: command not found: pod in zsh, but the causes and fixes are the same:
- CocoaPods is not installed.
- The CocoaPods install path is not in the
PATHenvironment variable. - Ruby, which CocoaPods needs, is missing or incompletely installed.
| Issue | Explanation |
| CocoaPods not installed | pod command is missing because CocoaPods has not been set up on the machine. |
| Path variable not updated | Bash does not know where to look for the pod command, even if it's installed. |
| Ruby environment issues | CocoaPods requires a functional Ruby environment. Issues here can affect pod. |
1. Check the Ruby installation
CocoaPods runs on Ruby, so verify Ruby first:
If Ruby is missing, install it with a package manager such as Homebrew on macOS:
2. Install CocoaPods
Install CocoaPods with gem:
sudo gives the administrative privileges needed for a system-wide install and avoids permission errors. Installing via gem downloads packages, so you need a working internet connection.
3. Add CocoaPods to your PATH
After a successful install, the terminal must be able to find the pod command. If the shell still cannot find it, add the gem executable directory to your PATH. To find where pod is installed:
Add that directory to .bash_profile, .bashrc or .zshrc. If CocoaPods was installed into /usr/local/bin, add:
Then reload the configuration:
If you use a shell other than Bash, make the change in that shell's configuration file: .zshrc for zsh, and profile.ps1 for PowerShell on macOS.
4. Verify the installation
This prints the installed CocoaPods version.
Avoiding the problem later
- Use a Ruby version manager such as RVM or rbenv to manage Ruby environments and avoid version-related problems with CocoaPods.
- Keep CocoaPods updated to get the latest features and security fixes.
Related reading
- Pod install displaying error in cocoapods version 1.0.0.beta.1
- Pod install is staying on Setting up CocoaPods Master repo
- Pod limit on Node - AWS EKS
- Pod not terminating
- Pods-resources.sh Permission denied in iOS Project
- Popover with embedded navigation controller doesn't respect size on back nav
- Pod receives traffic even Kubernetes readiness probe fails
- Pod Security Policy not working as intended
System design interview problems on this topic
- Design a Container Orchestration System: solution and walkthrough
- Design a Code Deployment System: solution and walkthrough
- Design a Task Scheduler: solution and walkthrough
- Design a GPU Cluster Scheduler for ML Training: solution and walkthrough

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseSystem Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.