rvm系统级安装:警告! PATH没有正确设置 [英] rvm system-wide install: Warning! PATH is not properly set up

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

问题描述

我在Ubuntu 12.10上安装了 / usr / local / rvm / bin 中的多用户版本的RVM。当我将Ruby从1.9.3升级到2.0.0时,似乎在执行 rvm version 或类似的命令时,会引起以下错误消息弹出:

I have the multi-user version of RVM installed in /usr/local/rvm/bin on Ubuntu 12.10. When I upgraded Ruby from 1.9.3 to 2.0.0 this seems to have caused the following error message to pop up whenever I execute rvm version or similar commands:

$ rvm version
Warning! PATH is not properly set up, '/usr/local/rvm/gems/ruby-2.0.0-p247/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.0.0-p247'.

rvm 1.22.16 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]

我已经尝试了相似的问题,但是 rvm get head rvm get head --auto-dotfiles 没有帮助。

I have tried the suggestions listed in similar questions, but rvm get head and rvm get head --auto-dotfiles did not help.

我在 .bashrc 的最后有以下几点:

I have the following at the very end of my .bashrc:

PATH=$PATH:/usr/local/rvm/bin # Add RVM to PATH for scripting                                                                      

我的路径是:

$ echo $PATH
./bin:/usr/local/sbin:/usr/local/bin:/usr/local/rvm/gems/ruby-2.0.0-p247/bin:/usr/local/rvm/gems/ruby-2.0.0-p247@global/bin:/usr/local/rvm/rubies/ruby-2.0.0-p247/bin:/usr/local/rvm/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

$ which rvm
/usr/local/rvm/bin/rvm

$ which ruby
/usr/local/rvm/rubies/ruby-2.0.0-p247/bin/ruby


推荐答案

RVM和PATH



RVM希望在PATH中首先找到它的bin目录。真正的RVM真的要确保它优先于任何系统二进制文件或宝石。要使RVM的系统安装快乐,您的PATH语句应该类似于:

RVM and PATH

RVM expects to find its bin directory first in your PATH. RVM really, really wants to ensure that it takes precedence over any system binaries or gems. To make a system install of RVM happy, your PATH statement should look similar to:

PATH=/usr/local/rvm/bin:$PATH

而你目前有这个倒置。这通常是正确的事和贸易;

whereas you currently have that inverted. This is generally The Right Thing™ to do.

如果你真的知道你在做什么,可以添加:

If you really know what you're doing, you can add:

rvm_silence_path_mismatch_check_flag=1

到您的 / etc / rvmrc 〜/ .rvmrc 文件。这将阻止RVM抱怨不是PATH中的第一个,但是很可能会为大多数人造成问题。

to your /etc/rvmrc or ~/.rvmrc file. This will prevent RVM from complaining about not being first in the PATH, but is very likely to cause problems for most people.

可能有合法的边缘案例,这是必要的,例如您希望优先使用〜/ bin 中的与Ruby相关的包装器脚本。但是,调试Ruby和RVM将会变得更加困难,所以如果您启用了此选项,则应该记住检查哪些-a&ruby | gem> 作为第一个故障排除步骤。

There may be legitimate edge cases where this is necessary, such as having Ruby-related wrapper scripts in ~/bin that you want to take precedence. However, debugging Ruby and RVM will be much harder, so you should remember to check which -a <ruby|gem> as your first troubleshooting step if you have this option enabled.

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

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