I've gone and messed up Ruby on my Snow Leopard Machine. I've managed to introduce all sorts of issues and I'm having a hard time cleaning things up.
What are the steps to get me back to square one with Ruby? I'm fairly new to programming so I need it spelled out for me!
Uninstall Ruby on Mac with rbenv For rbenv, use rbenv versions to see which versions you have installed. Use the uninstall command to remove a version. This will remove any gems associated with the version as well. If you want to reinstall Ruby, see Install Ruby on Mac for recommendations of newer version managers.
Pre-installed macOS system Ruby MacOS comes with a “system Ruby” pre-installed. If you see /usr/bin/ruby when you use the which command, it is the pre-installed macOS system Ruby.
First of all, Ruby is already pre-installed on your Mac. However, the pre-installed version is a few versions behind so we'll look into the other ways to install Ruby. Using a package management system makes your life easier when installing any software. On a Mac, you can use Homebrew to install newer versions of Ruby.
It sounds like what you probably want to do is clear out all your globally installed gems in the system Ruby. This can be done by running the following:
sudo rm -rf /Library/Ruby/Gems/*
This will leave all the gems that come with OS X (which is a good thing, since some apps may assume they're installed).
As macarthy said, I also highly recommend using a Ruby version manager (e.g. rbenv or RVM) to more easily install, remove, and manage Ruby versions.
My suggestion would be to forget about what you have and use RVM
you can basically ignore what you have installed then.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With