macOS 10.13 Beta 安装cocoapods时遇到 You don't have write permissions for the /usr/bin directory.

安装cocoapods时候 

命令 sudo gem install cocopods

提示

 tiantaodeMacBook-Pro:~ tiantao$ sudo gem install cocoapods

ERROR:  While executing gem ... (Gem::FilePermissionError)

You don't have write permissions for the /usr/bin directory.

解决方案 有人说 前面加sudo 明明已经加了 是无写入到/usr/bin directory 权限

后来查了些国外的论坛  执行此命令即可

sudo gem install cocoapods -n /usr/local/bin

推荐阅读更多精彩内容