默认 Ruby 未加载 RVM [英] Default Ruby not loading with RVM

查看:44
本文介绍了默认 Ruby 未加载 RVM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不确定这个问题是否与最近的 Oh-My-ZSH 更新有关,但突然之间,我的 RVM 默认 Ruby 在打开新的终端窗口时没有加载(而是加载系统 Ruby).

Not sure if this issue is related to a recent Oh-My-ZSH update, but all of a sudden, my RVM default Ruby is not loading when opening a new Terminal window (instead, it loads the system Ruby).

我添加了 [[ -s "$HOME/.rvm/scripts/rvm" ]] &&.$HOME/.rvm/scripts/rvm" 到我系统上的每个点文件(.zshrc、.zprofile、.zlogin、.profile,甚至 .bashrc 和 .bash_profile 都是很好的衡量标准).

I have added [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" to about every dotfile on my system (.zshrc, .zprofile, .zlogin, .profile, even .bashrc and .bash_profile for good measure).

会话开始时正在加载 RVM(我可以使用 rvm default 手动切换到默认值),并且 $HOME/.rvm/bin 在我的 $PATH 中.如果我切换到包含 .ruby-version 和/或 .ruby-gemset 文件的目录,它会加载该 Ruby.

RVM is loading when the session starts (I can manually switch to the default with rvm default), and $HOME/.rvm/bin is in my $PATH. If I switch to a directory with a .ruby-version and/or .ruby-gemset file, it loads that Ruby.

澄清一下,我的问题是我用 RVM 声明的默认 Ruby (rvm use --default) 在我开始新的终端会话或 时没有被加载cd 从包含 .ruby-version 文件的目录中.

To clarify, my problem is that the default Ruby I declared with RVM (rvm use <RUBY VERSION> --default) is not being loaded when I start a new terminal session or when I cd out of a directory that has a .ruby-version file.

编辑#2:这是rvm list

{15:20}[]~ ➭ rvm list

rvm rubies

ruby-1.9.3-p550 [ x86_64 ]
ruby-2.0.0-p594 [ x86_64 ]
ruby-2.1.3 [ x86_64 ]
* ruby-2.1.4 [ x86_64 ]

推荐答案

所以我想通了一半.我试图为该特定 Ruby 版本(rvm use 2.1.4@global --default)设置一个带有全局 gemset 的默认 Ruby.当我在没有 gemset 的情况下设置默认值时,它会持续存在并在每个后续会话中加载.

So I half figured this out. I was attempting to set a default Ruby with the global gemset for that particular Ruby version (rvm use 2.1.4@global --default). When I set the default without the gemset, it persists and is loaded in each subsequent session.

过去,我可以使用 gemset 加载默认值.不确定这是否是最新版本的 oh-my-zsh 或 rvm 的问题.

In the past I have been able to load the default with a gemset. Not sure if this is an issue with the latest version of oh-my-zsh or rvm.

这篇关于默认 Ruby 未加载 RVM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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