RVM集红宝石默认情况下,当打开新的终端擦除RVM设置,回到系统红宝石 [英] RVM set ruby default, when open new terminal erase the RVM setting, go back to system ruby
问题描述
我刚买了一台新的MacBook Pro,并试图安装在系统中RVM。我安装RVM并设置默认为
I just got a new MacBook Pro and tried to setup the RVM in the system. I installed RVM and set the default to
➜RVM列表默认
➜ rvm list default
默认红宝石(新弹)
红宝石1.9.3-P194 [x86_64的]
ruby-1.9.3-p194 [ x86_64 ]
我的RVM版
➜RVM --version
➜ rvm --version
RVM 1.16.8(主)由韦恩·E. Seguin的,米哈尔Papis [https://rvm.io/]
rvm 1.16.8 (master) by Wayne E. Seguin , Michal Papis [https://rvm.io/]
我已经把 [-s$ HOME / .rvm /脚本/ RVM]]&放大器;&安培;来源$ HOME / .rvm /脚本/ RVM#这RVM加载到一个shell会话。
在 .bashrc_profile 的底部。
当我打开新的终端窗口,我已经做了 RVM默认
每一个从系统红宝石重置RVM安装Ruby的时间。
When I open the new Terminal window, I have done rvm default
every time to reset from system ruby to rvm installed ruby.
我已经做了3小时研究和阅读有关此问题的20多个不同的博客。而我还没有为这个问题的解决方案。
I have done 3 hours research and read more than 20 different blogs about this issue. And I still do not have a solution for this problem.
推荐答案
如果RVM的是与中壳工作,但只是没有使用preferred红宝石为默认值,将其设置以下为1.9.3:
If RVM is working in the shell but just isn't using the preferred ruby as default, set it with the following for 1.9.3:
rvm --default use 1.9.3
如果RVM的不是工作,很可能是RVM没有加载登录shell问题:
If RVM isn't working, it's likely a login shell problem that RVM isn't loading:
登录shell(通常当在X窗口管理器中打开一个终端窗口)会使用的.bash_profile
,但互动性,非登录shell引用的.bashrc
(可能是那里的RVM壳code加载)。
Login shells (typically when a terminal window is opened in an X window manager) will use .bash_profile
but interactive, non-login shells reference .bashrc
(likely where the rvm shell code are loaded).
低价修复,它们符号链接:
Cheap fix, symlink them:
LN -s的〜/ .bashrc〜/ .bash_profile中
另外,一些终端(如GNOME终端)提供设置强制登录shell为每一个新的终端会话了。
Optionally, some terminals (e.g. gnome-terminal) offer settings to force login shells for each new terminal session too.
创建一个包含以下内容的 .bash_login文件
文件:
Create a .bash_login
file with the following contents:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
(猛砸将检查〜/ .bash_profile中
,那么〜/ .bash_login文件
,终于〜/ .profile文件
)
有关其它详细信息, bash帮助页面。
这篇关于RVM集红宝石默认情况下,当打开新的终端擦除RVM设置,回到系统红宝石的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!