Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rvm install <version> fails to regenerate gem wrappers when ls has been aliased in certain ways #4282

Closed
rdodson41 opened this issue Jan 16, 2018 · 3 comments · Fixed by #4283

Comments

@rdodson41
Copy link
Contributor

rdodson41 commented Jan 16, 2018

Description

rvm install <version> fails to regenerate gem wrappers when ls has been aliased in certain ways.

Steps to reproduce

  1. Alias ls as follows:
$ alias ls='"/usr/local/opt/coreutils/libexec/gnubin/ls" --format=long --human-readable --time-style=long-iso --classify --color=auto'
  1. Run rvm install ruby-2.4.3.

Expected behavior

Note the relevant successful steps:

ruby-2.4.3 - #importing gemset /Users/rich/.rvm/gemsets/global.gems.............................................
ruby-2.4.3 - #generating global wrappers.......

Actual behavior

Note the relevant errors when rvm attempts to regenerate gem wrappers:

ruby-2.4.3 - #importing gemset /Users/rich/.rvm/gemsets/global.gems.............there was an error installing gem gem-wrappers
.................................there was an error installing gem rvm
.
ruby-2.4.3 - #generating global wrappers.............
Error running 'run_gem_wrappers regenerate',
please read /Users/rich/.rvm/log/1516069374_ruby-2.4.3/gemset.wrappers.global.log

Note the relevant errors:

++ printf %b 'command(7): command gem install -rw-r--r-- 1 rich staff 13K 2018-01-15 21:20 /Users/rich/.rvm/gem-cache/gem-wrappers-1.4.0.gem --local --no-ri --no-rdoc\n'
++ rvm_log 'installing gem -rw-r--r-- 1 rich staff 13K 2018-01-15 21:20 /Users/rich/.rvm/gem-cache/gem-wrappers-1.4.0.gem --local --no-ri --no-rdoc'
++ [[ '' == 1 ]]
++ printf %b 'installing gem -rw-r--r-- 1 rich staff 13K 2018-01-15 21:20 /Users/rich/.rvm/gem-cache/gem-wrappers-1.4.0.gem --local --no-ri --no-rdoc\n'
++ command gem install '-rw-r--r-- 1 rich staff 13K 2018-01-15 21:20 /Users/rich/.rvm/gem-cache/gem-wrappers-1.4.0.gem' --local --no-ri --no-rdoc
++ gem install '-rw-r--r-- 1 rich staff 13K 2018-01-15 21:20 /Users/rich/.rvm/gem-cache/gem-wrappers-1.4.0.gem' --local --no-ri --no-rdoc
ERROR:  While executing gem ... (OptionParser::InvalidOption)
    invalid option: - 1 rich staff 13K 2018-01-15 21:20 /Users/rich/.rvm/gem-cache/gem-wrappers-1.4.0.gem
  • I suspect that the following line is responsible for this issue:

__available_gem="$( ls -v1 "${rvm_path}/gem-cache"/${gem_name}-${version_check}.gem 2>/dev/null | tail -n 1 )"

Environment info

@skunkworker
Copy link
Contributor

skunkworker commented Jul 22, 2019

@pkuczynski I'm seeing this behavior currently on zsh when using the alias alias ls='lsd'. Should I open another issue or use this one?

@pkuczynski
Copy link
Member

So the fix in #4283 does not work for you? Ideally, you might try to come up with a PR :)

@skunkworker
Copy link
Contributor

@pkuczynski I've got a tentative PR that works, I would love some feedback on the direction though as my strategy may not cover all that it needs to. #4743

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants