
On Mon, Feb 27, 2023 at 6:03 PM hmdne via ruby-talk <ruby-talk@ml.ruby-lang.org> wrote:
Well, on my Fedora system, I have a simple setup. I run a development shell with system Ruby and the following in my .bashrc:
export GEM_BIN=/home/user/Code/bin export GEM_PATH=/home/user/Code/.gem export GEM_HOME=/home/user/Code/.gem export PATH=/home/user/Code/bin:$PATH
This used to work, I could execute both gem and bundler commands correctly. Now (sometime around Ruby 3.2 upgrade) things changed and I have to set the flags to the gem command (and for instance `--user-install` is handled by `gem install` but not `gem pristine` so I have to use even different flags). Yet again, with each new installation (or upgrade), I have to undertake to make things simply work.
I believe Fedora changed the way they handled the default installation path a few years ago, they now set --user-install by default, but that doesn't work in all commands. Either way, if you are setting GEM_HOME, that should take precedence. If it doesn't work in a certain situation, I would be interested in that, since I predict my patch wouldn't work in that situation as well (but I think it should work in all situations).
But again, while I would say installing gems to a home directory by default was a good choice Fedora made, I would disagree with an idea of distributions having to choose what to do. Sometimes I encounter a Debian server or workstation and then I have to be aware of the extra steps I have to make.
The rubygems developers should at least make it easier for distributions to do user installations by default if they want to, and right now it's anything but easy (which is why all distributions do it differently). My patch makes it extremely easy. Cheers. -- Felipe Contreras