简体   繁体   中英

Permission Denied in rvm update and rvm remove

There is rvm 1.19.6 installed on ubuntu 12.04 with ruby 2.0.0 . Just receive permission denied when doing rvm get stable . Here is the error:

$rvm get stable
######################################################################## 100.0%
bash: line 535: /home/ubuntu/.rvm/RELEASE: Permission denied
Could not update RVM, get some help at #rvm IRC channel at freenode servers.

When we are trying to installing readline on the server, the rvm remove 2.0.0 creates the permission deny error:

$rvm remove 2.0.0
tee: /home/ubuntu/.rvm/log/ruby-2.0.0-p0/1367720906_remove.src.log: Permission denied
tee: /home/ubuntu/.rvm/log/ruby-2.0.0-p0/1367720906_remove.src.log: Permission denied
Removing /home/ubuntu/.rvm/src/ruby-2.0.0-p0...........
.........
Error running '__rvm_rm_rf /home/ubuntu/.rvm/rubies/ruby-2.0.0-p0',
please read /home/ubuntu/.rvm/log/ruby-2.0.0-p0/1367720907_remove.rubies.log
rm: cannot remove `/home/ubuntu/.rvm/bin/ruby-2.0.0-p0': Permission denied
Removing ruby-2.0.0-p0 aliases...
Removing ruby-2.0.0-p0 wrappers...
rm: cannot remove `/home/ubuntu/.rvm/wrappers/ruby-2.0.0-p0/ruby': Permission denied
rm: cannot remove `/home/ubuntu/.rvm/wrappers/ruby-2.0.0-p0/rake': Permission denied
rm: cannot remove `/home/ubuntu/.rvm/wrappers/ruby-2.0.0-p0/erb': Permission denied
rm: cannot remove `/home/ubuntu/.rvm/wrappers/ruby-2.0.0-p0/gem': Permission denied

We tried to delete ~/.gem/ and assign the right to ~/.gem/specs following this post , it did not work. What's wrong with the rvm? Thanks for help.

pulling from comments.

rvm was installed as root, and needs to be owned by the ubuntu user (or you need to run all commands as root)

sudo chown -R ubuntu .rvm will fix the permissions errors

as for the ruby 2.0.0@global it doesn't need to be removed. if you look at the rvm documents that is used as a place to install gems that should be across all gemsets for that particular version of ruby for instance I have bond, hirb, wirb, awesomeprint all in my global as they are referenced in my .irbrc . So as I create per project gemsets I always have them available to me (things like bundler are also handy there)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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