卸载后无法安装可可豆荚,导致报错 [英] Cannot install cocoa pods after uninstalling, results in error
问题描述
我删除了可可豆荚,因为它声称已安装,但后来一直说没有找到命令豆荚.尝试重新安装 cocoapods (sudo gem install cocoa pods -v
) 时出现此错误:
I removed cocoa pods because it claimed it had installed, but kept saying the command pod wasn't found afterward. When trying to reinstall cocoapods (sudo gem install cocoa pods -v
) I get this error:
错误:执行 gem 时 ... (Errno::EPERM)不允许操作 -/usr/bin/pod
ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /usr/bin/pod
有什么想法吗?
推荐答案
正如它已经指出的那样 下面由 Ramesh Ramchandaran,这是一种更简洁的方法,而不是绕过 OS X 的安全功能.
As it has been pointed out below by Ramesh Ramchandaran, this is a cleaner way of doing it, instead of getting around the Security features of OS X.
sudo gem install -n /usr/local/bin cocoapods
原答案
我假设您运行的是 OS X 10.11.
Original Answer
I'm assuming you're running OS X 10.11.
发生这种情况是因为 Apple 在新安装中启用了 rootless.
This is happening because Apple has enabled rootless on the new install.
如果你输入:
sudo nvram boot-args="rootless=0"; sudo reboot
在 terminal.app
中,您的计算机将在禁用的情况下重新启动.
in terminal.app
, your computer will reboot with it disabled.
完成后,输入:
sudo gem install cocoapods -V
-V
用于详细说明,如果发生错误会吐出.
the -V
is for verbose and will spit out any errors if they happen.
这篇关于卸载后无法安装可可豆荚,导致报错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!