When I upgraded to Bionic, Ruby was upgraded from its default Xenial version 2.3 to its default Bionic version 2.5. That means that Ruby gem-provided programs that I installed via
gem install no longer work, and
gem uninstall doesn’t work either because it fails to find Ruby 2.3 and bails out.
I know it’s not good practice on Ubuntu to use gem to install Ruby libraries you need for development, and I haven’t, but I have used it to install executable programs that are distributed that way.
(My intention going forward is to use
checkinstall and/or a PPA for such cases; I know better now. But this question is about the cleanup.)
To give an example, at this moment I have an unexecutable version of the Rubygem
github-linguist, with its main runnable installed in /usr/local/bin/linguist. I can install the new Bionic apt package
ruby-github-linguist, which besides installing into
/usr/bin rather than
/usr/local/bin, installs its executables under the names
git-linguist, where the older Rubygem installed
git-linguist (they are two different programs, with the new
github-linguist corresponding to the old
So not only do I have a name clash (and for various reasons I put
/usr/bin in my PATH), but the old version in
/usr/local/bin is impossible to execute, and
gem uninstall fails as well.
As I said, I’ve learned my lesson, and hopefully by first making such programs (and similar cases like Python
easy_install-based programs or Golang programs) into APTs in my PPA, I won’t have to deal with this when I upgrade from Bionic.
But right now, I already have this useless (at best) cruft on my system. How can I remove this and other pre-Bionic Ruby 2.3 gems from my system?
(I realize the answer is almost certainly different for executables installed using Python’s
go get, Haskell’s
cabal install, Node’s
npm -i, etc.—but if there is a single tool or strategy that can be used across such cases, so much the better.)