wayneeseguin/rvm — Issue #618: Duplicate rvm entry in $PATH
Author: Cueball
Created: 2011-11-25 10:31:46+00:00
State: open

[Note - this is *not* a dup of https://github.com/wayneeseguin/rvm/issues/74 - before anyone asks :-) ]

I've been able to replicate this on Mac OS X 10.7.2 (multi-user install) and Ubuntu Server 11.11 (single-user install) using rvm head.

Gist for each scenario...note the duplicate path entries at the end of the first two gists. These entries appear after rvm has been freshly installed and a new terminal opened, but 'rvm ' has never actually been invoked prior to the point you see in the middle of each gist.

Mac OS X 10.7.2 multi-user install - issue present: https://gist.github.com/1393179

Ubuntu Server 11.11 single-user install - issue present: https://gist.github.com/1393180

Mac OS X 10.7.2 multi-user install - with issue corrected: https://gist.github.com/1393181

The fix? Remove the extraneous space after {rvm_bin_path} in scripts/function/env:48 (part of ):

if printf "${PATH//:/ }" | \grep -vF "${rvm_bin_path} " >/dev/null 2>&1

becomes:

if printf "${PATH//:/ }" | \grep -vF "${rvm_bin_path}" >/dev/null 2>&1

Now I could be smoking crack, given that this space appears to have been present "for some time" - if so, feel free to point that out and close this issue with extreme prejudice :-D

[I'd have sent a pull request but it seems too trivial...]