Removing all installed Gems and starting over

2019-03-07 15:31发布

I recently started learning Ruby and Ruby on Rails, and have watched a plethora of getting started materials. I have been finding lately that I keep getting errors where gems won't install or they will be installed but they can't be used for some reason, and I have decided that I want to remove everything down to once again just having Ruby installed and start over with the installation. One training video had me install most of my gems with RVM, so I don't know if that changes anything.

So in short my question is "How to I get rid of RVM, Rubygems, and all installed Gems so that I can start over with just Ruby?"

Edit: I am on Mac OS 10.6

7条回答
趁早两清
2楼-- · 2019-03-07 16:31

Step 1:

I first kept running into an error that said:

You don't have write permissions for the /usr/bin directory

To get permission, I became a root user with (this is potentially dangerous for reasons beyond my current understanding):

sudo -s

Credit

Step 2:

Then, I kept running into an error that said:

[gem] cannot be uninstalled because it is a default gem

This allowed me to uninstall everything:

for i in `gem list --no-versions`; do gem uninstall -aIx $i; done

Credit

查看更多
登录 后发表回答