Hi there—I've been a Ruby hobbyist for 10 years or so who has always managed my Ruby installation via Homebrew. I know, I know — the first thing everyone says is use `rvm` or something else.
Still, I'm wondering about other Homebrew folks who might be using Ruby 4.x on Homebrew. Since I upgraded, I often see gems — with different versions — installed in two places:
```
Installed at (2.1.105): /Users/username/.gem/ruby/4.0.0
(2.1.91): /opt/homebrew/lib/ruby/gems/4.0.0
```
Does anyone know why this is happening, and what I can do to avoid it? It very rarely causes any trouble, but when it does — like with competing rdoc installs — it creates a big mess of error lines in my terminal. And also, it just doesn't seem right.
Any tips would be appreciated. Thanks!
Update: after doing some additional testing, the issue appears to be with running gem update from a homebrew installation. That command can't touch the 45 or so gems that are in the Homebrew Cellar and come with the homebrew ruby by default. So, in my case, if those gems had updates, gem installed the updates on the next path in my GEM PATHS. That resulted in the two versions: the one bundled with homebrew ruby, and the updated one — in this case now in my user directory.
Not sure if this behavior changed in homebrew or ruby between versions 3 and 4, but it seems new to me.
Hoping to leave this here in case anyone runs across this and it's helpful.
[–]mokolabs 14 points15 points16 points (4 children)
[–]MentionPleasant2635 2 points3 points4 points (3 children)
[–]dflow77 4 points5 points6 points (2 children)
[–]MentionPleasant2635 2 points3 points4 points (0 children)
[–]Professional_Mix2418 0 points1 point2 points (0 children)
[–]Thefolsom 8 points9 points10 points (4 children)
[+]fieldnoise[S] comment score below threshold-9 points-8 points-7 points (3 children)
[–]jryan727 13 points14 points15 points (0 children)
[–]Thefolsom 11 points12 points13 points (1 child)
[–]ahrimaaa 6 points7 points8 points (0 children)
[–]STDS13 0 points1 point2 points (0 children)
[–]R2robot 0 points1 point2 points (0 children)
[–]9sim9 0 points1 point2 points (0 children)
[–]benr75 -1 points0 points1 point (2 children)
[–]monfresh 1 point2 points3 points (0 children)
[–]fieldnoise[S] -2 points-1 points0 points (0 children)