Cannot install CocoaPods in macO

2017-03-23  本文已影响40人  CharlesZhang

When I trying to install the cocoapods rubygem (sudo gem install cocoapods),I got this error.

ERROR:  While executing gem ... (Errno::EPERM)
  Operation not permitted - /usr/bin/pod

I'm using an administrator account, how would I go about fixing permissions?
'pod' is not exist in /usr/bin,and I cannot touch podin /usr/bin,because the Security features of OS X.
So I tried specifying a new bin directory throughsudo gem install -n /usr/local/bin cocoapods but that didn't solve my problem.

52C8D84C-3442-42FD-AF6E-2F4304422313.png

I have successfully installed cocoapods.But I got this error.pod: command not foundBecause my $PATH is not right .

And how to modify the Shell path in macOS Sierra using terminal ?

Rearranging the default path.

Move into the home directory nano .bash_profile Create the **.bash_profile ** file with a command line editor called nano export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

osx-path-modify1.png

Save the file in nano by clicking ‘control’ +’o’ and confirming the name of the file is .bash_profile by hitting return.
And the ‘control’+’x’ to exit nano .
So now when the Terminal is relaunched or a new window made and you check the the path by 'echo $PATH' .
You will get a new path .
Then run 'pod setup'

上一篇下一篇

猜你喜欢

热点阅读