I'm learning to code on ruby and before knowing any better I installed some gems with
sudo gem install name-of-gem
If your system comes with a built-in ruby, it (and the gems) are in protected folder. To install gems, you need
Normally, though, you leave the system ruby alone and install newer version with one of the ruby version switchers (RVM, chruby/ruby-install, rbenv/ruby-build). But before you discovered version switchers, you may have installed some gems with
sudo into the system ruby.
which gem and
sudo which gem return different paths (which likely means that under
sudo you use system ruby and not your custom one), you can safely uninstall all of the gems you installed with