美文网首页
Cannot install CocoaPods in macO

Cannot install CocoaPods in macO

作者: CharlesZhang | 来源:发表于2017-03-23 19:40 被阅读40次

    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'

    相关文章

      网友评论

          本文标题:Cannot install CocoaPods in macO

          本文链接:https://www.haomeiwen.com/subject/jumtottx.html