6

当我尝试重新安装最新版本的 RVM 时,RVM 给了我一个与“$PATH”变量丢失或不正确有关的错误通知。有谁知道(a)这个变量应该设置为什么以及(b)如何改变它?

我已经搜索了几十个线程,但似乎没有一个完全引用这个问题。任何帮助将不胜感激。

谢谢, 科迪

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.
4

2 回答 2

18

这不是错误,解决方法是将 $PATH 添加到您的 export PATH= 行,因此您应该:

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
于 2013-05-07T20:16:53.670 回答
3

向您显示该消息是因为硬编码是不好的做法PATH,它会破坏例如在中完成的任何动态配置,/etc/profile.d/*.sh这是 OH-MY-ZSH => https://github.com/robbyrussell/oh的错误-my-zsh/拉/1359

要修复它,只需删除该行,它不应该存在。

于 2013-05-07T23:43:56.430 回答