安装了Ruby 1.9.3,但是ruby -v继续在每个新终端上显示1.8.7 [英] Installed Ruby 1.9.3 but ruby -v keeps showing 1.8.7 every new terminal

查看:98
本文介绍了安装了Ruby 1.9.3,但是ruby -v继续在每个新终端上显示1.8.7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

虽然我通过RVM安装了Ruby 1.9.3,但是每次我打开一个新终端并运行"ruby​​ -v"时,我都会得到:

Eventhough I have Ruby 1.9.3 installed via RVM, every time I open a new Terminal and run "ruby -v" I get:

ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin11.0]

"rvm列表"显示:

rvm rubies

   ruby-1.9.3-p362 [ x86_64 ]
=* ruby-1.9.3-p374 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

我尝试输入"rvm use 1.9.3 --default",但它仅适用于当前的终端会话.打开新终端始终会恢复为1.8.7.

I've tried entering "rvm use 1.9.3 --default" but it only works for the current terminal session. Opening new terminals always reverts back to 1.8.7.

我还确保我的〜/.bash_profile包含在末尾:

I've also made sure that my ~/.bash_profile contains at the end:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

我该怎么做,以免每次打开终端时都不必键入"rvm use 1.9.3"?

What can I do so that I don't have to type "rvm use 1.9.3" every time I open a terminal?

推荐答案

请确保您的.rvm目录位于PATH

这篇关于安装了Ruby 1.9.3,但是ruby -v继续在每个新终端上显示1.8.7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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