RVM/rbenv rvm -v 命令

rails_on_ll · 2016年03月05日 · 最后由 rails_on_ll 回复于 2016年03月07日 · 8085 次阅读

今天查看 rvm 的版本信息,输入 rvm -v,出来以下的提示信息

Warning! PATH is not properly set up, $GEM_HOME is not set, 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-head'. rvm 1.26.11 (latest) by Wayne E. Seguin [email protected], Michal Papis [email protected] [https://rvm.io/]

利用这个帖子里面的内容解决方法 没有解决 请问各位同学是如何解决这个问题的,就是 GEM_HOME 的设置问题,不让他出来警告信息,直接输出 rvm 版本号,谢谢

没用过 rvm,一直用 rbenv

命令行运行 echo $PATHecho $GEM_HOME 输出啥?

貌似 $PATH 的开头必须是 $GEM_HOME/bin 才不会输出这个 warning

利用这个帖子里面的内容解决方法 没有解决

能否详细说说你具体怎么操作的?

#1 楼 @fighterleslie 我的.bash_profile(shell 第一次登陆时执行)文件中有这句 [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* 我修改了我的.bashrc(非登陆交互式 shell 初始化文件) 文件中,设置了 GEM_HOME 环境变量,如下: export GEM_HOME="/home/ll/.rvm/gems/ruby-2.2-head/bin" 然后我将 GEM_HOME 下 bin 目录添加到 PATH 中,如下: export PATH="$GEM_HOME/bin:$HOME/.rvm/bin:$PATH" 最后执行 source .bashrc 就没有警告信息了,出现警告信息的原因是因为找不到 GEM_HOME,在 bashrc 中进行设置就可以了

需要 登录 后方可回复, 如果你还没有账号请 注册新账号