View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000443 | AlmaLinux-8 | ruby | public | 2023-11-16 07:03 | 2024-09-05 12:52 |
Reporter | emacalinao | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | new | Resolution | open | ||
Summary | 0000443: `gem install --install-dir` and `--bindir` behavior differs from documentation | ||||
Description | Method operating_system_defaults at https://git.almalinux.org/rpms/ruby/src/branch/c8-stream-2.5/SOURCES/operating_system.rb#L98-L110 forces binary files to be written to bin/ in the user's home directory when `gem install` is executed as a non-root user, ignoring the GEM_HOME environment setting. From https://guides.rubygems.org/command-reference/#gem-environment: "RubyGems’ default local repository can be overridden with the GEM_PATH and GEM_HOME environment variables. GEM_HOME sets the default repository to install into. " The expected behavior is for binstubs to be installed in $GEM_HOME/bin by default, which differs from the AlmaLinux 8 implementation. Referring to line https://git.almalinux.org/rpms/ruby/src/branch/c8-stream-2.5/SOURCES/operating_system.rb#L103 : If the user specifies `--no-user-install`, having the operating_system_defaults method inject `--bindir #{File.join [Dir.home, 'bin']}` to put binstubs in the user's home directory (as it does now) doesn't make sense. If the user specifies `--install-dir`, `gem install` will fail with output "ERROR: Use --install-dir or --user-install but not both" because operating_system_defaults adds `--user-install`. This renders the `--install-dir` option unusable on its own. Both issues can be worked around by passing in additional arguments (see Steps to Reproduce section), but the solutions are unintuitive. Suggestion: how about not adding both `--user-install` and `--bindir...` if the user specifies either `--no-user-install` or `--install-dir`? | ||||
Steps To Reproduce | As a user other than root: > mkdir gem_home > export GEM_HOME=$PWD/gem_home > gem install bundler -v 1.17.3 > ls ~/bin/bundler # confirm that the bundler executable was written to ~/bin > ls $GEM_HOME/bin # fails, directory doesn't exist Work-around: > gem install bundler -v 1.17.3 --bindir $GEM_HOME/bin Also, > gem install bundler --install-dir $GEM_HOME ERROR: Use --install-dir or --user-install but not both Work-around: > gem install bundler --install-dir $GEM_HOME --no-user-install | ||||
Tags | No tags attached. | ||||
abrt_hash | |||||
URL | |||||
Date Modified | Username | Field | Change |
---|---|---|---|
2023-11-16 07:03 | emacalinao | New Issue | |
2024-09-05 12:52 | emacalinao | Note Added: 0001061 | |
2024-09-05 12:52 | emacalinao | File Added: image.png |