2

I've been dabbling in Ruby and Ruby on Rails for a year or two and somewhere along the line I've completely buggered up my installation of RVM.

Everything has a permission denied message. rvm get head has permission denied, rvm repair has permission denied, and installing RubyGems always needs my password.

I'm at a stage where I cannot even generate a controller anymore because I don't have permissions.

Out of sheer desperation I ran rvm implode and...I guess I can't uninstall either as that has permission denied too.

I just want to completely wipe Ruby, Rails, and RVM from my MacBook and start over. What are my options?

Tamachan87
  • 277
  • 5
  • 11
  • Never use a `sudo` command with RVM unless you absolutely know why you should. `sudo` changes the user to the system administrator, who has entirely different permissions and ownership than you do. And don't run as root either, for the same reasons. Your entire system can disappear or halt in a split second with the wrong command. With great power comes great responsibility... one of my coworkers just accidentally took out a shared development host by accidentally adding one extra character, so be careful. – the Tin Man Aug 02 '13 at 14:41

2 Answers2

7

update RVM using rvmsudo:

rvmsudo rvm get head

fix permissions:

rvm fix-permissions

this two commands should do it for you

mpapis
  • 52,729
  • 14
  • 121
  • 158
  • Blimey, I wish I knew about `rvm fix-permissions` last week... And I had no idea about using `rvmsudo rvm foo`. Is there any particular reason they have `rvmsudo rvm`? Seems a bit unnecessary, surely it would already know I want to run an rvm command? – Tamachan87 Aug 02 '13 at 13:08
  • `rvmsudo` is for any command not just `rvm`, for example: `rvmsudo rails -s p 80` - I would not encourage that command - but it shows good that the `rvm` command can not be assumed – mpapis Aug 02 '13 at 19:16
6

rvm implode should do the trick. Incase you are getting permission denied errors, just change its permission using sudo chmod 777 -R <FILE_OR_DIR_NAME_HERE> or run sudo rvm implode

CuriousMind
  • 33,537
  • 28
  • 98
  • 137
  • This was what I was looking for, thanks. I had had a few commands saying they don't exist when I run `sudo rvm foo` which was why I didn't think of it. Currently in the middle of reinstalling Ruby 2.0 – Tamachan87 Aug 02 '13 at 13:07
  • I think it is sudo chmod -R 777 – Aspasia Jan 22 '14 at 18:46
  • 1
    one thing to note about `rvm implode` is if you `ctrl+c` to cancel the confirmation prompt, it will still execute `rvm implode` – skilleo Mar 13 '15 at 17:10