How to remove Ruby and gems from your system
Delete custom gems installed at the user level - only your user could run them.
$ rm -rf ~/.gem
Delete system-wide custom gems - any user could run them. If only root has access to modify this directory, then you'll need to run with
$ rm -rf /usr/local/lib/ruby/
That directory contains
site_ruby by the way.
Remove the custom Ruby using your package manager.
$ brew uninstall ruby
$ sudo apt remove ruby ruby-dev
Or, if you installed as
ruby-full, then run:
$ sudo apt remove ruby-full