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

Ethan Humphries picture Ethan Humphries · Dec 9, 2016 · Viewed 38k times · Source

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.

Answer

Caleb Kleveter picture Caleb Kleveter · Dec 9, 2016

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