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

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

问题描述

我已经安装在的/ usr /本地/ RVM /斌在Ubuntu 12.10 RVM的多用户版本。当我升级的Ruby 1.9.3从为2.0.0,这似乎引起以下错误消息弹出每当我执行 RVM版本或类似的命令:

  $ RVM版本
警告!路径没有正确设置,/usr/local/rvm/gems/ruby-2.0.0-p247/bin'不是在首位,
通常这是由shell初始化文件引起的 - 检查它们的PATH = ...项,
这也可能有助于RVM重新添加到您的点文件:RVM获得稳定--auto-点文件',
临时固定在这个shell会话运行:RVM使用Ruby-2.0.0-P247。RVM 16年1月22日(稳定)由韦恩·E. Seguin的< wayneeseguin@gmail.com> ;,米哈尔Papis< mpapis@gmail.com> [https://rvm.io/]

我曾尝试在<上市的建议href=\"http://stackoverflow.com/questions/17968580/warning-path-is-not-properly-set-up-usually-this-is-caused-by-shell-initializa\">similar问题,但 RVM GET头 RVM GET头--auto-点文件并没有帮助。

我在的尽头我的的.bashrc 以下内容:

  PATH = $ PATH:在/ usr /本地/ RVM / bin中#添加RVM到PATH的脚本

和我的路径是:

  $回声$ 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$其中RVM
在/ usr /本地/ RVM /斌/ RVM$其中红宝石
/usr/local/rvm/rubies/ruby-2.0.0-p247/bin/ruby


解决方案

RVM和PATH

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

  PATH =的/ usr /本地/ RVM /斌:$ PATH

而您目前有反转。这通常是正确的事与贸易;做的。

忽略错误

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

  rvm_silence_path_mismatch_check_flag = 1

您的的/ etc / rvmrc 〜/ .rvmrc 的文件。这将prevent RVM的抱怨不是第一位的路径,但很容易造成对大多数人的问题。

有可能是合法的边缘情况下,这是必要的,如在有Ruby的相关包装脚本的〜/斌的要采取precedence。然而,调试Ruby和RVM会更难,所以你应该记得检查这-a&LT;红宝石|宝石&GT; 作为你的第一个故障排除步骤,如果你启用这个选项

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/]

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

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

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

And my path is:

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

Ignoring the Error

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

rvm_silence_path_mismatch_check_flag=1

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.

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系统范围的安装:警告!路径没有正确设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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