简体   繁体   中英

zsh: command not found: pod - MAcOS Catalina 10.15

I'm running the install with an admin account I tried

sudo gem install cocoapods

and

sudo gem install cocoapods -n /usr/local/bin

They both run fine with following output

Fetching cocoapods-1.9.1.gem
Successfully installed cocoapods-1.9.1
Parsing documentation for cocoapods-1.9.1
Installing ri documentation for cocoapods-1.9.1
Done installing documentation for cocoapods after 2 seconds
1 gem installed

however, a simple

pod --version

Returns

zsh: command not found: pod

I'm not too good at managing users accounts or dealing with command shell but I scoured the net and couldn't find a solution. It looks like wherever pod is installed, it doesn't make it to the list of executable applications

The issue was that command line for XCODE was not installed.

First I updated to latest Ruby version and put the version number in the second command (in place of [version]

curl -L https://get.rvm.io | bash -s stable

rvm install ruby-[version] 

During the install you will see the Software update available from MAcOS popup. Install immediately and continue with prompts in that window (I believe it asks for updates and then asks for install.

It will take a while to run / download / install (it took 2 expressos for me:) )

After that I ran

sudo gem install cocoapods

And restarted my terminal. Now checking it's installed

pod --version

Returns the installed version (1.9.1 for me)

I followed these instructions but ended up with the same issue. So I ran gem list | grep cocoapods gem list | grep cocoapods and then uninstalled every instance of cocoapods with gem uninstall cocoapods along with the executables. Then I decided to install cocoapods using Homebrew with brew install cocoapods , restarted my Mac and the pod command was available. Remember I didn't restart my Mac after using sudo gem install cocoapods ,maybe that will work too, you can try.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM