问题描述
我刚刚运行"rvm稳定",得到以下错误;
I just ran 'rvm get stable' to be given the below error;
Warning! PATH is not properly set up, '/Users/jamesbkemp/.rvm/gems/ruby-2.2.1/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-2.2.1'.
在运行"rvm获得稳定"之前,我将酿造升级红宝石"运行到Ruby 2.2.2.
Previous to running 'rvm get stable' I ran 'brew upgrade ruby' to Ruby 2.2.2.
'echo $ PATH'返回以下内容:
'echo $PATH' returns the below:
/usr/local/heroku/bin:/Users/user/.rvm/gems/ruby-2.2.1/bin:/Users/user/.rvm/gems/ruby-2.2.1@global/bin:/Users/user/.rvm/rubies/ruby-2.2.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/user/.rvm/bin:/Users/user/.rvm/bin
我不明白这里的问题是什么,为什么我运行'ruby -v'时会返回'ruby 2.2.1p85'.
I don't understand what the issue is here or why when i run 'ruby -v' it returns 'ruby 2.2.1p85'.
运行"rvm列表"将返回以下信息,以及上面详述的相同PATH错误消息;
Running 'rvm list' returns the below, as well as the same PATH error message detailed above;
ruby-2.0.0-p353 [ x86_64 ]
ruby-2.0.0-p451 [ x86_64 ]
ruby-2.1.0 [ x86_64 ]
ruby-2.1.5 [ x86_64 ]
=* ruby-2.2.1 [ x86_64 ]
ruby-2.2.2 [ x86_64 ]
任何人都可以帮忙吗?
推荐答案
在$ PATH开头放置RVM代码
我只是遇到了同样的问题.我去了终端,输入subl ~/
,它会在Sublime Text上打开您的主文件夹(或者您可以使用其他文本编辑器).
Put RVM code at the start of $PATH
I just had the same problem. I went to terminal and entered subl ~/
which opens up your home folder on Sublime Text (or you can use another text editor).
然后,我点击以.
开头的每个文件,例如.bash_profile
,.bashrc
,.mkshrc
,.zshrc
I then clicked on every file starting with .
, e.g. .bash_profile
, .bashrc
, .mkshrc
, .zshrc
每当我看到以下行:
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
我将其更改为:
export PATH="$HOME/.rvm/bin:$PATH" # Add RVM to PATH for scripting
这样,RVM代码位于$PATH
的开头.然后我退出终端并再次启动它,以确保已加载那些配置文件.
That way, the RVM code is at the start of $PATH
. Then I quit Terminal and started it up again to make sure those config files were loaded.
这篇关于$ PATH设置不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!