installing gems using rvm

喜你入骨 提交于 2020-01-20 17:23:29

问题


When trying to install gems using rvm i get this error

$ 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

when i type $GEM_HOME it shows that the directory is pointing to the rvm dir

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

Any ideas what I'm doing wrong?


回答1:


There's a permission issue with your .gem folder. Make sure the owner is your current user.

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

If it doesn't work, remove the .gem folder. It is automatically created when you update the gem cache.

Also, make sure you never used sudo with rvm.




回答2:


I was having the same problem. I redid this command

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




回答3:


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

or just

$ rvm <ruby_version>
$ gem install sproutcode

This should definitely work.




回答4:


its probably not the correct way of doing things but I found that using rvmsudo resolved the issue, eg

rvmsudo gem install rails




回答5:


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.

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.

If you want to know the subject better read https://rvm.io/rvm/install . You will see that Single User Install is the recommended .



来源:https://stackoverflow.com/questions/3853489/installing-gems-using-rvm

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!