1

I am trying to use Cocoapods, but I'm stuck with even setting it up properly. It keeps showing me

-bash: pod: command not found

and I can't do anything. Also, the

$ pod init

doesn't work. I suppose the my computer cannot find any commands related to Cocoapods.

I've followed all the ways that was listed on the Cocoapods website, and read from websites such as raywenderlich but nothing helped.

$ sudo gem install cocoapods
Successfully installed cocoapods-1.7.5
Parsing documentation for cocoapods-1.7.5
Done installing documentation for cocoapods after 2 seconds
1 gem installed
$ pod setup --verbose
-bash: pod: command not found

I expect it to clone the CocoaPods Master Specs repository into ~/.cocoapods/ on my computer. Please help.

minovermax
  • 17
  • 4
  • No clue. Have you tried a restart or killing terminal? I'd also trying doing this: `sudo gem install -n /usr/local/bin cocoapods`. For more see [here](https://stackoverflow.com/q/49213136/5175709). Not sure if it would help, but it just might – mfaani Sep 12 '19 at 14:22
  • sudo gem install -n /usr/local/bin cocoapods worked. – minovermax Sep 12 '19 at 15:34

1 Answers1

1

I actually thought you'd get the "You don't have write permissions for the /usr/bin directory." error, but your successfully installing it. I'm not sure why it's installing it in and then reading from another.

Try installing in a different directory:

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

For more see here

mfaani
  • 33,269
  • 19
  • 164
  • 293