Leonardo Hammer Leonardo Hammer - 1 month ago 8
iOS Question

Unknown command 'pod' in directory /

Why I can't use cocoapods command

pod
in directory /

/ $ pod
fish: Unknown command 'pod'
/ $


If use command in home directory, it work well.

~ $ pod
Usage:

$ pod COMMAND

CocoaPods, the Cocoa library package manager.

Answer Source

Find the reason, my cocoapods install in chruby ruby 2.4, and .ruby-version file in home directory.

So, the root directory not have .ruby-version file, just use system base ruby, that not install cocoapods. So Unknown command error occur.

At last, I copy my ~/.ruby-version to /.ruby-version, it's work!