RVM installation missing $PATH

2019-04-08 02:20发布

问题:

When I attempted to reinstall the latest version of RVM, RVM gave me an error notice related to a missing or incorrect "$PATH" variable. Does anyone know (a) what this variable should be set to and (b) how to alter it?

I've searched dozens of threads, but none appears to reference this problem exactly. Any help would be greatly appreciated.

Thanks, Cody

Codys-MacBook-Pro:demo_app Cody$  rvm get head && rvm reload
######################################################################## 100.0%
Downloading RVM from wayneeseguin branch master
Upgrading the RVM installation in /Users/Cody/.rvm/
RVM PATH line found in /Users/Cody/.bashrc /Users/Cody/.zshrc.
RVM sourcing line found in /Users/Cody/.bash_profile /Users/Cody/.zprofile.

Upgrade Notes:

/Users/Cody/.bash_profile:3:export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin:/Users/Cody/.rvm/bin

* WARNING: Above files contains `PATH=` with no `$PATH` inside, this can break RVM,
for details check https://github.com/wayneeseguin/rvm/issues/1351#issuecomment-        10939525
to avoid this warning append #PATH.

Upgrade of RVM in /Users/Cody/.rvm/ is complete.

回答1:

It's not an error and the fix is to prepend $PATH to your export PATH= line, so you should have:

export PATH=$PATH:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin:/Users/Cody/.rvm/bin


回答2:

The message is displayed to you because it is bad practice to hard code PATH, it breaks any dynamic configuration that is done for example in /etc/profile.d/*.sh, here is a bug for OH-MY-ZSH => https://github.com/robbyrussell/oh-my-zsh/pull/1359

To fix it just remove the line, it should never be there.



标签: ruby rvm