If you’ve been testing different programming languages to see which one works best for you or for a project you’re working on, you will probably have installed Ruby. Ruby is a popular object-oriented programming language used to build everything from websites to complete applications. If you no longer use it — perhaps because you decided Python or Swift were a better fit — you should uninstall Ruby to free up space on your Mac and keep it free from clutter. We’ll show you how to do that.
What is Ruby?
Ruby is a general-purpose programming language that was designed to be as productive as possible while emphasizing simplicity. Its syntax is known for being elegant and easy to read and write, and its fans even describe it as beautiful and artful as well as practical. Everything in Ruby is an object. It has been used to create static websites, desktop applications, and automation tools as well as to run web servers and carry out web scraping and crawling tasks. While it is still used for commercial web applications, most data visualization and machine learning programs are now written in Python.
How to uninstall Ruby the easy way
There are a few different ways to uninstall Ruby on your Mac, depending on how you installed it and how you run it. If you use an integrated development environment (IDE) to code in Ruby, the easiest way to uninstall it is to use a dedicated uninstaller. This will not only remove the app, but it will also scan your Mac for all the files it has placed in different folders since you installed it, saving you the trouble of locating them individually.
We recommend CleanMyMac X to do the job for you. It allows you to uninstall multiple apps at the same time. So, if you use several apps to code in Ruby you can get rid of them all at once — with just a few clicks. It’s free to download here. Once you’ve downloaded it, follow the steps to uninstall Ruby on your Mac:
- Open CleanMyMac X and choose Uninstaller in the sidebar.
- In the right-hand pane, locate and select the app or apps you use to code in Ruby.
- Once you’ve selected them all, click the Uninstall button.
Remove Ruby from Mac manually
Before we show you how to uninstall Ruby manually, a note of caution. There is a system version of Ruby pre-installed on your Mac, in the /usr/bin/ directory. That’s used by macOS and you shouldn’t try to uninstall it.
You can check which versions of Ruby are installed on your Mac by going to Applications > Utilities, launching Terminal and typing the command below:
$ which -a ruby
If the only version of Ruby is /usr/bin/ruby, there is nothing to uninstall. If there are other versions listed, you can uninstall those.
The method for uninstalling Ruby manually is dependent on the package installer you used to install it in the first place. The most commonly used package installer is Homebrew, so we’ll show you the Terminal commands for uninstalling Ruby using Homebrew.
To see a list of Ruby files installed by Homebrew, use the command below in Terminal:
$ brew list ruby
To uninstall all the files listed there, used the command:
$ brew uninstall --force ruby
And to remove unused dependencies, type:
$ brew autoremove
To check that Ruby has been completely uninstalled, use the command:
$ brew list ruby
The final step is to edit the zsh configuration file to remove the section that gives Homebrew Ruby priority over the system Ruby.
- In Finder, click the Go menu, choose Go to Folder and paste this path: ~/.zshrc
- Open the file in Text Edit.
- On an Intel-based Mac, delete this section:
if ; then
export PATH=/usr/local/opt/ruby/bin:$PATH
export PATH=gem environment gemdir/bin:$PATH
fi - On an Apple Silicon Mac, remove this section:
if ; then
export PATH=/opt/homebrew/opt/ruby/bin:$PATH
export PATH=gem environment gemdir/bin:$PATH
fi
If you used a package installer other than Homebrew to install Ruby, you will need to use that to uninstall it and the syntax of the Terminal command may be different. For example, if you used asdf then the uninstall command would be:
$ asdf uninstall Ruby
How to reset Ruby
If the IDE you use to code Ruby isn’t working as it should, you can try resetting it using CleanMyMac X.
- Open CleanMyMac X and choose Uninstaller in the sidebar.
- Locate and select the IDE from the list of all apps.
- Click the dropdown menu next to the IDE and choose Reset.
- Click the Reset button.
If you installed Ruby on your Mac and now no longer need it, follow the steps above to uninstall it.