安装ruby gems错误:操作也不允许 - usr / bin / sprockets

时间:2016-04-20 08:39:36

标签: ruby rubygems

我试图让rubymine起作用,但我总是不断收到这个错误"操作不允许"

Gabriellas-MBP:~ GabriellaKampe$ gem install rails
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
Gabriellas-MBP:~ GabriellaKampe$  sudo gem install rails
Password:
ERROR:  While executing gem ... (Errno::EPERM)
    Operation not permitted - /usr/bin/sprockets
Gabriellas-MBP:~ GabriellaKampe$ 

1 个答案:

答案 0 :(得分:0)

您无权写入与操作系统捆绑在一起的ruby版本的gemfile目录。您需要做的是使用rbenvrvm管理您的ruby版本。我会推荐rbenv,您可以按照这些链接rbenv rails install Mac OSrbenv rails install Ubuntu

的指南进行操作