1

I has been install a ruby version 3.1.2 at my Mac computer and I want to uninstall it completely.

When I check by this command

which -a ruby

It show me this

/Users/nguyencuc/.rubies/ruby-3.1.2/bin/ruby
/usr/bin/ruby

So, as this page said, https://mac.install.guide/ruby/9.html, maybe it is a system ruby ?

So how can I completely uninstall this ruby to install another version of ruby ? Could you please give me some advices ? Thank you very much for your time.

Nguyen Cuc
  • 89
  • 1
  • 9
  • 1
    How did you install it? – Stefan Nov 24 '22 at 11:40
  • @Stefan I installed it by this command : brew install rbenv ruby-build – Nguyen Cuc Nov 24 '22 at 12:12
  • For `rbenv` / `ruby-build` see https://github.com/rbenv/rbenv#uninstalling-ruby-versions. However, your directory (`~/.rubies`) looks more like an installation from `chruby` / `ruby-install`. If so, see https://stackoverflow.com/questions/27665381/how-to-uninstall-ruby-installed-by-ruby-install – Stefan Nov 24 '22 at 12:36

2 Answers2

3

As you have installed ruby, not using rbenv or rvm, there are two ways through which you can remove it.

  1. Using Command brew uninstall --force ruby
  2. Or you have to manually remove the ruby files from your system. Type whereis ruby to find where it is installed and then remove the files using rm
Syed Uzair
  • 61
  • 3
0

If you have installed ruby via Rbenv, type this:

rbenv uninstall 3.1.2

For installing another version, type:

 rbenv install *version*
Taimoor Hassan
  • 365
  • 2
  • 11