pod install -bash pod command not found
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
In the world of iOS development, CocoaPods is a widespread dependency manager. It simplifies the process of integrating third-party libraries into your projects. However, developers might encounter the error -bash: pod: command not found when trying to use CocoaPods on their system. This issue generally arises when the system cannot identify the pod command, indicating CocoaPods has not been installed or isn't referenced correctly in your system's path.
Let's delve deeper into this problem, its causes, and solutions.
Understanding the Error
The error message -bash: pod: command not found typically surfaces when the terminal, particularly Bash in this case, cannot find the pod command due to one of the following reasons:
- CocoaPods is not installed.
- The installation path of CocoaPods is not included in the system PATH environment variable.
- Incorrect or incomplete installation of Ruby or its environment, which is required to run CocoaPods.
Key Points
| 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. |
Steps to Resolve the Error
Here's a step-by-step guide to fixing the -bash: pod: command not found error.
1. Checking Ruby Installation
CocoaPods requires Ruby to be installed on your system. Begin by verifying your Ruby installation:
If Ruby is not installed, you can install it with a package manager like Homebrew on macOS:
2. Installing CocoaPods
Once Ruby is installed, proceed to install CocoaPods via the terminal using the gem command:
The sudo command ensures that you have administrative privileges to install the software system-wide.
3. Updating the Path
After successful installation, ensure that the path of CocoaPods is available to the terminal so that Bash recognizes the pod command. You may need to add the gem executable directory to your PATH. To find the installation path, use the command:
Add the directory path, where pod is located, to your .bash_profile, .bashrc, or .zshrc file. Suppose CocoaPods was installed into /usr/local/bin, you would add the following line:
After editing, update your terminal configuration with:
4. Verifying Installation
To confirm CocoaPods has been installed correctly, run:
This should display the installed version of CocoaPods.
Additional Considerations
PowerShell or zsh Users
Users employing a shell other than Bash, such as zsh or PowerShell on macOS, should ensure the path modification is done in the appropriate configuration file (.zshrc for zsh and profile.ps1 for PowerShell).
Troubleshooting Common Issues
- Permissions Error: Use
sudowhen installing CocoaPods to avoid permission-related issues. - Network Issues: Ensure your internet connection is reliable when installing via gem, as it fetches packages online.
Best Practices
- Utilize a Ruby Version Manager: Tools like RVM or rbenv can manage multiple Ruby environments and alleviate version-related issues while working with CocoaPods.
- Keep CocoaPods Updated: Regularly update CocoaPods to leverage the latest features and security patches.
In conclusion, resolving the -bash: pod: command not found error involves ensuring a proper installation of both Ruby and CocoaPods, appropriately configuring environment paths, and keeping your development tools updated. By following the steps outlined above, developers can seamlessly integrate CocoaPods into their workflow, allowing them to leverage the vast array of libraries available for iOS development.
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 limit on Node - AWS EKS
- Pods-resources.sh Permission denied in iOS Project
- Popover with embedded navigation controller doesn't respect size on back nav
- Pod not terminating
- Pod receives traffic even Kubernetes readiness probe fails

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.