zsh: command not found: pod problem solved
Question:
After cocoapods is installed successfully:
sudo gem install cocoapods
Still getting error, prompt:
zsh: command not found: pod
Solution:
——Add environment variables
- Find the pod program address (my pod is in
/usr/local/lib/ruby/gems/3.1.0/bin
) - Open
/Users/[your username]
and find .bash_profile (if you can’t find it, google it yourself) - A text editor opens, and is added at the end (taken from 1):
export PATH="/usr/local/lib/ruby/gems/3.1.0/bin:$PATH"
- Open the terminal and enter
source ~/.bash_profile
5.Enter pod to check whether the pod is available——
pod