Cannot install CocoaPods in macOS sierra

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'

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • cocoapods安装过3次都蜜汁失败 在第七次终于成功 下列附上过程 有耐心的朋友可以试试的我的步骤和方法 ps...
    _Dam0n阅读 2,503评论 0 1
  • 第一次安装CocoaPods也遇到了一些坑,但是 那个时候时间比较紧,没有抽出时间整理,最近因为电脑还原从新做了系...
    幸福的尾巴__阅读 8,361评论 7 9
  • 你是
    中波6557888阅读 151评论 0 1
  • 从前有一个城市, 他的墙都是灰色, 他的街道曲折凋剥, 从前有一个城市, 没有白天黑夜, 没有窗户和花朵, 传说中...
    西疆阅读 193评论 0 0
  • 呃呃呃呃呃额额额呃呃呃呃哦哦哦哦哦哦哦 摸摸摸她 就急了哦哦哦哦 哦哦哦 陌陌摸摸摸哦哦哦幸福
    在德国骨科养老吧阅读 216评论 0 0