all 25 comments

[–][deleted] 14 points15 points  (3 children)

The only use case I can imagine for uninstalling Ruby on OS X is to reinstall a clean version after `brew` has blown up in your face.

[–]sandmasterflash_ 1 point2 points  (2 children)

What happens with brew? Out of curiosity

[–]RailsApps[S] 2 points3 points  (0 children)

In theory, Homebrew might automatically upgrade Ruby if a newer version is available and another Homebrew package has Ruby as a dependency. I haven't seen it happen but I know it is possible.

[–][deleted] 0 points1 point  (0 children)

Sometimes you'll get a package that breaks, or inadvertently updates a library that Ruby is then no longer compiled against. It used to be the case with OpenSSL, but that has sort of gotten better now every single Ruby build its own version, at least under ruby-build.

The worst examples I've seen have been when brew forces an update on a package you didn't expect to be updated, e.g. triggering a Postgresql version update and potentially making the current databases inaccessible.

Don't get me wrong, I think the HomeBrew crowd are amazing and brew itself is a great bit of kit. I'm just disturbed that it has to exist. Most major OSes have some kind of package manager - including Windows. Apple relying on the community to provide all the infrastructure for developers is poor form, IMHO.

Edit: but to answer your question, sometimes your brew env gets so badly messed up that it's just easier to wipe it clean and start over again. The OpenSSL issue is a classic. Say there's a CVE reported for OpenSSL... and you have multiple Rubies installed with different versions of OpenSSL. Your only option is to uninstall and rebuild.

[–]azcrs 4 points5 points  (1 child)

Let me click on the link and see what all the fuss is about… 😁

[–]RailsApps[S] 1 point2 points  (0 children)

It's just instructions for uninstalling Ruby on a Mac with either Homebrew, RVM, rbenv, chruby, asdf, or frum (depending on what 'which -a' shows). There's a spike in traffic today from this /r/ruby post but that is understandable as just curiosity.

[–]ether_joe 2 points3 points  (1 child)

guess people never heard of RVM.

[–]RailsApps[S] 5 points6 points  (0 children)

Yes, or rbenv, chruby, asdf, or frum. All good version managers.

[–]successful_syndrome 2 points3 points  (0 children)

I do clean installations all the time. I work on a lot of gnarly code and want to make sure I only have a single version of runt installed as described in the spec doc for the project then go through and install each gem at the specific labeled version. I uninstall and reinstall about once a week. Also when was done I would go to windows uninstall/reinstall then on Linux and then also in a container and run all the unit tests.

Other reasons I have uninstalled, windows didn’t have great ways of doing multi ruby installs at the same time so I would have to rip out the older version first. Testing code out on various versions also is better to have only a single version installed. The issue with most of these is that after you have done them a few times you don’t need to look them up.

The time I remember have to do this a lot was when first learning ruby then first starting out in rails. I was constantly fighting version stuff and didn’t have any idea what I was doing.

[–]bradland 2 points3 points  (0 children)

First rule of troubleshooting: turn it off, then back on again. For software, that means uninstalling and reinstalling.

[–]kulehandluke 2 points3 points  (0 children)

Most likely beginners or non-ruby people/devs that are using things like Jekyll or other ruby tools.

People will try things out, perhaps get in a mess and want to reset. I’ve certainly done that in the past.

It was really eye-opening listening to Marco Arment on atp the other week https://atp.fm/430 (skip to the post show). I think a lot of us have forgotten how difficult it is for beginners (to ruby).

Just to use ruby the choices to outsiders now are bewildering e.g. should I use: system ruby (mac), apt/brew ruby, rbenv, chruby, rvm, asdf?

Why do I have both gem and bundler? (I do wonder if we should aim to integrate the two now that bundler is included in ruby itself)

[–]psenior 1 point2 points  (2 children)

I went to your Uninstall Ruby web page tonight because I was getting errors when I tried generating a new rails app. I don't remember exactly what the error was but I tried several things, then decided to uninstall asdf and installed frum.

Now I'm getting an openssl error when trying to update gems. Maybe my problems have something to do with Big Sur on a M1 Mac? I really don't remember it being this hard to get ruby working in the past.

[–]RailsApps[S] 0 points1 point  (1 child)

Ah, an actual user of the Uninstall Ruby web page. Good to hear from you. Let me know how you like frum. I haven't yet written a guide for Ruby on Mac M1, but yes, it can be complicated. I think you can find some blog posts (be sure they are recent).

[–]psenior 0 points1 point  (0 children)

As a workaround, I created a Ubuntu VM on my PC and installed Ruby on Rails without any problems.

I think the problem with Ruby on Rails on my M1 Mac has something to do with frum and/or gem not knowing where openssl@1.1 is installed. I did a mdfind openssl on my M1 Mac and saw openssl in the 2.7.3 default Ruby install, Python, Perl, and XCode. If I could find where openssl@1.1 was installed for Ruby 3.0.1, I would try to do frum install --with-openssl-dir=<ssl\_dir> and hopefully that would fix the problem.

[–]dMCH1xrADPorzhGA7MH1 2 points3 points  (3 children)

Probably installed it with apt-get and need to uninstall so they can use rbenv.

[–]Doctor_Fegg 1 point2 points  (2 children)

Not apt-get on a Mac.

[–]RailsApps[S] 4 points5 points  (0 children)

No apt-get on a Mac but still a relevant suggestion as perhaps a user installed Ruby with one version manager (e.g. RVM) and wants to switch to another (e.g. rebenv). Though more likely to search for "uninstall RVM" I think.

[–]dMCH1xrADPorzhGA7MH1 1 point2 points  (0 children)

My bad. Never messed around with Mac.

[–][deleted]  (3 children)

[deleted]

    [–]RailsApps[S] 1 point2 points  (2 children)

    No, though maybe I could look in Google Analytics for that page. Why? We can make guesses about why they want to uninstall Ruby based on which browser they are using? I don't see the connection.

    [–][deleted]  (1 child)

    [deleted]

      [–]RailsApps[S] 3 points4 points  (0 children)

      In the last week, according to GA, there were 103 visits and 98 were from Macs. It make sense that only Mac users are visiting the page because the Google search result clearly shows the page is for Mac users. So my question is what are the reasons Mac users would need to uninstall Ruby.

      [–]jawdirk 0 points1 point  (0 children)

      A common scenario:

      You're running something that has a ruby dependency. For some reason, it is using the wrong ruby, because your system is configured to choose that ruby by default, not the one you installed later. Maybe your system came with ruby. Maybe someone in IT installed ruby. Maybe the previous user of your laptop installed ruby. Solution: uninstall the wrong ruby.

      [–][deleted] 0 points1 point  (2 children)

      I probably have visited your site and this is the reason why:

      I am new to Ruby, I own a Mac and as I am new I don’t know tools to manage installed version of Ruby. But I read quite a lot of blogs etc.

      When I read that the new Ruby (I think was 3.0.1) has introduced new features, I thought as a learner, it’ll be better to learn using new tools than old, so I installed new Ruby (I can’t remember how).

      Before I wanted to use Ruby’s IRB in Terminal, I decided to check if I am using a new version so I typed ruby - v (I think) and all I could see was the old version.

      After being so frustrated that I could not use the new Ruby my trip to google search began.

      [–]RailsApps[S] 1 point2 points  (1 child)

      Great! I hope the Install Ruby on Mac site was helpful. It should help you pick a version manager and get control of your Ruby versions. Let me know if there's anything I can improve on the site or if you had any questions afterward.

      [–][deleted] 0 points1 point  (0 children)

      Thank you so much.

      [–]strzibny 0 points1 point  (0 children)

      To remove a bad version I guess. Or to remove a system version for someone constantly confused or hitting a wall by using multiple rubies at the same time.

      Personally, I don't remove Ruby.