刚刚将一台恢复出厂的Mac升级到10.13.4,安装cocoapods,输入sudo gem install cocoapods
命令后返回结果显示
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/bin directory.
多方查找后得出解决方法,或许是新系统没有创建bin文件夹?
不求甚解,解决命令如下:
sudo gem install -n /usr/local/bin cocoapods
直接顺滑安装,over。