Skip to main content

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

  1. Find the pod program address (my pod is in /usr/local/lib/ruby/gems/3.1.0/bin)
  2. Open /Users/[your username] and find .bash_profile (if you can’t find it, google it yourself)
  3. 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"
  1. Open the terminal and enter
source ~/.bash_profile

5.Enter pod to check whether the pod is available——

pod