Leonardo Hammer Leonardo Hammer - 3 months ago 16
iOS Question

Unknown command 'pod' in directory /

Why I can't use cocoapods command

in directory /

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

If use command in home directory, it work well.

~ $ pod


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!