安装cocoapods时遇到错误
2018-11-15 本文已影响0人
棉花糖716
1、安装cocoapods时遇到错误
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /usr/bin directory.
2、解决方案
-
方案一:
sudo gem install cocoapods -n /usr/local/bin
ps:缺点 之后安装其他插件时还会报错
-
完美解决方案:
(1) 打开 ~/.gemrc file
vim ~/.gemrc
(2) 在最后添加:
:gemdir: - ~/.gem/ruby install: -n /usr/local/bin
Ps:优点 之后安装所有插件都正常安装