RVM安装缺少$ PATH

时间:2013-05-07 20:12:16

标签: ruby rvm

当我尝试重新安装最新版本的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.

2 个答案:

答案 0 :(得分:18)

这不是错误,修复是将$ PATH添加到导出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

答案 1 :(得分:3)

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

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