I recently wrote Uninstall Ruby for my guide Install Ruby on Mac. I added it just for completeness not expecting much traffic but now it is getting a lot of visits. Like, really a lot.
Why would a developer need to remove Ruby? Any insights? I’d like to better understand why people are visiting that page.
Because some Gems have become unfathomably broken and starting from a clean slate is the only thing that seems to work. I’d say I’ve had to do it a good 5 times.
Ah, that may be one reason people are trying to uninstall Ruby.
Yeah as a casual Ruby user who has had to touch it a few times for work I’ve ended up having to nuke my install a few times once things got irreparably screwed up
if you update your system beyond what the native C extensions to the gem that were compiled to the system expect you have to rebuild the gems again… that’s a very common thing in ruby and not really the fault of ruby at all. the price of admission to have native extensions. I expect python to have a similar issue. ruby probably needs to be reinstalled too come to think of it since that’s built expecting some native libraries to be there.
A guess; to get rid of the conflicting system ruby?
It looks like the article explicitly tells you not to uninstall system Ruby and discusses only how to install Ruby from other places. My guess, from limited interaction with Ruby beyond the pain of conflicting versions of Ruby packages, is that it’s increasingly seen as a bad idea to have a global version of things like Ruby and Python installed and instead to have separate locally installed trees.
It’s interesting that most of the traction that Go is making relative to Python comes from having exactly this model: you install packages for dependencies only in your build directory, not anywhere globally, and the thing that you ship is a statically linked binary. There’s a weird conflict in the Python ecosystem between ‘write it in Python, everyone has Python installed out of the box’ and ‘make sure you use pipenv to avoid touching any system-wide packages, and make sure you have exactly this version Python you need installed for that environment’. Both are sensible (it’s great to ship something small and depends on things that are there already and to have a central place to manage security updates, it’s also great if the thing works when you install it), it’s just not possible for both to coexist.
That’s a good way to put it.
I’ve always been told to leave the system Ruby alone, install a version manager, and set a $PATH to use the version manager. Isn’t that good enough?
Back in the gemsets days and aggressively keeping up with Ruby releases across multiple projects, I could quickly eat up several gigabytes of storage space on a 128 GB SSD. Uninstalling was a cleanup step often forgotten, delayed unintentionally until something notified me that I was running low on disk space. Then, it was easier to just… wipe the RVM rubies directory and start afresh.
Kondo keeps my systems tidy now when I want to cleanup short of wiping everything, across multiple stacks.
ruby version managment is a pain exactly because of Mac os system ruby.
I uninstall broken versions of Ruby so apps don’t even run when they require the broken version.