RVM警告! PATH没有正确设置 [英] RVM Warning! PATH is not properly set up

查看:1048
本文介绍了RVM警告! PATH没有正确设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在我的Mac上安装了rvm,但是我在全局命令中收到了此警告。


警告! PATH没有正确设置,'/usr/local/rvm/gems/ruby-1.9.3-p194/bin'不在第一位,通常这是由shell初始化文件引起的 - 检查它们是否为'PATH = .. 。'条目,它可能还有助于将RVM重新添加到您的点文件中:'rvm get stable --auto-dotfiles',以便在此shell会话中暂时修复:'rvm use ruby​​-1.9.3-p194'。


我的$ PATH确认警告:

  $ echo:$ PATH:
:/ usr / local / rvm / bin:/ usr / local / heroku / bin:/usr/local/rvm/gems/ruby-1.9.3-p194/bin :/usr/local/rvm/gems/ruby-1.9.3-p194@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p194/bin:在/ usr /本地/ RVM /斌: / opt / local / bin:/ opt / local / sbin:/ usr / local / bin:/ usr / local / sbin:/ usr / bin:/ bin:/ usr / sbin:/ sbin:

如前所述,我首先尝试 rvm get stable --auto-dotfiles 没有用,然后我检查了我的shell初始化文件。我的/.bash_profile:

$ $ p $ export PATH = / usr / local / bin:/ usr / local / sbin:$ PATH
export PATH = / usr / local / share / python:$ PATH
PATH = $ PATH:$ HOME / bin:/ opt

我的/Users/User/.bash_profile似乎是罪魁祸首:

  export PS1 =[\ w] $
alias ll ='ls -laGH'
alias。='echo $ PWD'

###由Heroku Toolbelt
export PATH =/ usr / local / heroku / bin:$ PATH

#rvm
PATH = / usr / local / rvm / bin:$ PATH
[[-s$ HOME / .rvm / scripts / rvm]]&&源代码$ HOME / .rvm / scripts / rvm#将RVM加载到shell会话中*作为函数*

原因是如果我删除了Heroku Toolbelt和rvm路径(这是其他堆栈溢出问题提出的答案), /usr/local/rvm/gems/ruby-1.9.3-p194/ bin 将排在第一位并解决问题。但是,我不知道如何处理Heroku Toolbelt。另外,请不要 PATH = / usr / local / rvm / bin:$ PATH 首先放置rvm?

我必须缺少一些简单的解决方案。



其他注意事项:
$ rvm --debug get head 不会产生安装说明,除了更新:调用 rvm system 修复了这个问题,但只在当前的shell会话中解决了问题。

$ echo $ PATH 现在生成:

 :/ usr / local / Heroku的/ bin中中:/ opt / local / bin目录中:/ opt / local / sbin中:在/ usr / local / bin目录:在/ usr / local / sbin中:在/ usr / bin中:/ bin中:/ usr / sbin目录:/ sbin目录:/ USR / local / rvm / bin:

什么是永久性修复?


解决方案

b
$ b

我修改了〜/ .bashrc ,如下所示:

<$ p $ #$ ## rvm
PATH =$ GEM_HOME / bin:$ HOME / .rvm / bin:$ PATH#将RVM添加到PATH以编写脚本
[-s $ { HOME} /。rvm / scripts / rvm]&&源$ {HOME} /。rvm / scripts / rvm



导致:



警告在
$ HOME / .rvm / scripts / functions / cli 中的__rvm_path_match_gem_home_check()函数中被触发。



如果 $ PATH 的开头不是从 $ GEM_HOME / bin

  __ rvm_path_match_gem_home_check()
{
(($ {rvm_silence_path_mismatch_check_flag: -0} == 0))||返回0
[[-n$ {GEM_HOME: - }]] ||在
($ GEM_HOME / bin:*)中返回0
case$ PATH:true ;; #所有在这里
(*:$ GEM_HOME / bin:*)
__rvm_path_match_gem_home_check_warning不在第一位
;;
(*)
__rvm_path_match_gem_home_check_warning不可用
;;
esac
}


I just installed rvm on my mac, but I receive this warning on global commands

Warning! PATH is not properly set up, '/usr/local/rvm/gems/ruby-1.9.3-p194/bin' is not at first place, usually this is caused by shell initialization files - check them for 'PATH=...' entries, it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles', to fix temporarily in this shell session run: 'rvm use ruby-1.9.3-p194'.

My $PATHS confirms the warning:

$echo :$PATH:
:/usr/local/rvm/bin:/usr/local/heroku/bin:/usr/local/rvm/gems/ruby-1.9.3-p194/bin:/usr/local/rvm/gems/ruby-1.9.3-p194@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p194/bin:/usr/local/rvm/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:

As suggested, I first tried rvm get stable --auto-dotfiles to no avail, then I checked my shell initializations files. My /.bash_profile:

export PATH=/usr/local/bin:/usr/local/sbin:$PATH
export PATH=/usr/local/share/python:$PATH
PATH=$PATH:$HOME/bin:/opt

My /Users/User/.bash_profile seems to be the culprit:

export PS1="[\w]$"
alias ll='ls -laGH'
alias .='echo $PWD'

### Added by the Heroku Toolbelt
export PATH="/usr/local/heroku/bin:$PATH"

# rvm
PATH=/usr/local/rvm/bin:$PATH
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

The reason is if I remove Heroku Toolbelt and the rvm paths (which were answers suggested by other stack overflow questions), /usr/local/rvm/gems/ruby-1.9.3-p194/bin would be in first place and the problem is resolved. However, I don't know what to do with the Heroku Toolbelt. Additionally, shouldn't PATH=/usr/local/rvm/bin:$PATH place rvm first anyways?

I must be missing some trivial solution.

Additional notes: $rvm --debug get head produces no installation notes regarding this except for the warning posted above.

Update: calling rvm system fixes the problem, but only in the current shell session. $echo $PATH now produces:

:/usr/local/heroku/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/rvm/bin:

What is a permanent fix?

解决方案

I have the same problem with rvm 1.25.26.

solution:

I've modified ~/.bashrc as follows:

## rvm
PATH="$GEM_HOME/bin:$HOME/.rvm/bin:$PATH" # Add RVM to PATH for scripting
[ -s ${HOME}/.rvm/scripts/rvm ] && source ${HOME}/.rvm/scripts/rvm

causing:

Warning is fired at __rvm_path_match_gem_home_check() function in $HOME/.rvm/scripts/functions/cli.

If the beginning of $PATH does not start from $GEM_HOME/bin, a warning message is displayed.

__rvm_path_match_gem_home_check()
{
  (( ${rvm_silence_path_mismatch_check_flag:-0} == 0 )) || return 0
  [[ -n "${GEM_HOME:-}" ]] || return 0
  case "$PATH:" in
    ($GEM_HOME/bin:*) true ;; # all fine here
    (*:$GEM_HOME/bin:*)
      __rvm_path_match_gem_home_check_warning "is not at first place"
      ;;
    (*)
      __rvm_path_match_gem_home_check_warning "is not available"
      ;;
  esac
}

这篇关于RVM警告! PATH没有正确设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆