错误:执行 gem 时 ... (Errno::EPERM) 不允许操作 [英] ERROR: While executing gem ... (Errno::EPERM) Operation not permitted
问题描述
我刚刚将我的 Mac 更新到 OSX 10.11 El Capitan,一些 gem 没有保留.
I just updated my Mac to OSX 10.11 El Capitan and some gems didn't remain.
当我尝试运行不同 gem 的安装时出现了问题...例如:
The problem arose when I tried to run installations of different gems... e.g.:
> sudo gem install compass
一旦我执行,我就会得到错误:
Once I execute, I get the error:
> ERROR: While executing gem ... (Errno::EPERM) Operation not permitted
其他宝石也会发生这种情况......
This happens with other gems, as well...
我已经运行 Homebrew 并尝试再次安装 Ruby,但没有任何效果.
I've run Homebrew and tried to install Ruby again, but nothing is working.
推荐答案
我在SASS问题上找到了答案:https://github.com/sass/sass/issues/1768
I found the answer on SASS issues: https://github.com/sass/sass/issues/1768
自OSX el Capitan
以来,有一个新的安全功能可以防止您修改系统文件,称为Rootless.所以你有两个选择:
Since OSX el Capitan
there is a new security function that prevents you from modifying system files called Rootless. So you have 2 options:
如果你在
/usr/local/bin
上安装 gems 不会有问题,因为 rootless 不会影响这个路径.
If you install gems on
/usr/local/bin
there will be no problem because rootless doesn't affect this path.
sudo gem install -n/usr/local/bin GEM_NAME_HERE
这篇关于错误:执行 gem 时 ... (Errno::EPERM) 不允许操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!