Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"pod init" giving error "-bash: pod: command not found"

I am trying to create a Podfile for my Xcode project for Firebase compatibility, but when I try to create it within the same file that my Xcode project is stored in, using my terminal and typing "pod init", it throws the error "-bash: pod: command not found".

I am up to date on OSX as far as I'm aware, using Sierra 10.12.1, but I am unfamiliar with the use of Podfiles, so any help here would be great, thanks.

like image 286
Ethan Humphries Avatar asked Dec 09 '16 16:12

Ethan Humphries


People also ask

Where do you put pods in Podfile?

Run open Podfile. Which opens the Podfile in textEdit. Add pod'CorePlot', '~> 1.4' to it and save. Run pod install -- NOTE* that is **pod update if already installed.


4 Answers

Looks like you didn't install CocoaPods.

To do that you install it through ruby gems, like this:

sudo gem install cocoapods 

If you don't have admin privileges, try:

gem install cocoapods --user-install 
like image 183
Caleb Kleveter Avatar answered Sep 20 '22 15:09

Caleb Kleveter


if the 1st command doesn't work, try the 2nd command

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

In my case, the 2nd command worked

like image 40
Diptendu Das Avatar answered Sep 17 '22 15:09

Diptendu Das


For OS Catalina (as of December 2019)

gem install -n /usr/local/bin cocoapods
like image 22
Samarey Avatar answered Sep 20 '22 15:09

Samarey


Brew install

$ brew install cocoapods      

For me sudo gem install cocoapodsdid not work.
When I tried $sudo gem install -n /usr/local/bin cocoapods it threw me weird error messages. But brew install was pretty neat.

like image 39
Rohit Singh Avatar answered Sep 17 '22 15:09

Rohit Singh