安裝cocoapods時(shí)候
命令 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.
解決方案 有人說(shuō) 前面加sudo 明明已經(jīng)加了 是無(wú)寫入到/usr/bin directory 權(quán)限
執(zhí)行此命令即可
sudo gem install cocoapods -n /usr/local/bin
問(wèn)題二 如果遇到ERROR: While executing gem ... (Errno::EACCES)
Permission denied @ rb_sysopen - /Users/XXX/.gemrc
再操作命令行前面加上 sudo以此來(lái)獲取權(quán)限
比如 刪除淘寶鏡像gem sources --remove https://ruby.taobao.org/
調(diào)整為 sudo gem sources --remove https://ruby.taobao.org/
依舊好用