简体   繁体   English

使用rvm安装宝石

[英]installing gems using rvm

When trying to install gems using rvm i get this error 当尝试使用rvm安装gem时,我收到此错误

$ rvm gem install sproutcore
ERROR:  While executing gem ... (Errno::EACCES)
Permission denied - /home/tee/.gem/specs

but it says on the rvm site that you should not use sudo so I'm not sure whats wrong with my setup 但它在rvm网站上说你不应该使用sudo,所以我不确定我的设置有什么问题

when i type $GEM_HOME it shows that the directory is pointing to the rvm dir 当我键入$ GEM_HOME时,它显示该目录指向rvm目录

$GEM_HOME
bash: /home/tee/.rvm/gems/ruby-1.8.7-p302: is a directory

Any ideas what I'm doing wrong? 我有什么想法我做错了吗?

There's a permission issue with your .gem folder. 您的.gem文件夹存在权限问题。 Make sure the owner is your current user. 确保所有者是您当前的用户。

sudo chown -R tee /home/tee/.gem

If it doesn't work, remove the .gem folder. 如果它不起作用,请删除.gem文件夹。 It is automatically created when you update the gem cache. 更新gem缓存时会自动创建它。

Also, make sure you never used sudo with rvm. 另外,请确保您从未使用过rvm的sudo。

I was having the same problem. 我遇到了同样的问题。 I redid this command 我重做了这个命令

user$ source ~/.rvm/scripts/rvm user $ source~ / .rvm / scripts / rvm

from a new terminal window (as suggested when installing rvm and possibly overlooked when I was installing rvm) and things seemed to be fine after that 从一个新的终端窗口(如安装rvm时建议的那样,当我安装rvm时可能会被忽略)事情似乎很好

http://rvm.io/set/gem/ http://rvm.io/set/gem/

or just 要不就

$ rvm <ruby_version>
$ gem install sproutcode

This should definitely work. 这绝对有用。

its probably not the correct way of doing things but I found that using rvmsudo resolved the issue, eg 它可能不是正确的做事方式,但我发现使用rvmsudo解决了这个问题,例如

rvmsudo gem install rails rvmsudo gem安装rails

I was having the same problem because the RVM was installed globally, in /usr/local/rvm , so it had no permission to install gems in ruby directory. 我遇到了同样的问题,因为RVM是全局安装在/ usr / local / rvm中的,所以它没有权限在ruby目录中安装gem。

The workaround is to use Single User Installation, this will install your rvm in your user's home directtory(~/.rvm) so it will have all necessary permissions to install the gemsets and gems. 解决方法是使用单用户安装,这将在您的用户的家庭直升机(〜/ .rvm)中安装您的rvm,因此它将拥有安装gemsets和gem的所有必要权限。

If you want to know the subject better read https://rvm.io/rvm/install . 如果您想更好地了解主题,请阅读https://rvm.io/rvm/install You will see that Single User Install is the recommended . 您将看到建议使用单用户安装。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM