RVM 使用了错误的 ruby 版本

RVM using wrong ruby version

我在使用 ruby 时遇到了问题,在修复它的过程中我安装了更新的版本。但是,当我打开终端 window 并输入 ruby -v 时,我得到 - ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin13.2.0]

此版本已损坏(例如,我无法 运行 rails s)

如果我 运行 这个命令:rvm --default use ruby-2.1.4,那么世界上一切都是正确的,我很好......直到我打开一个新终端 window。

有人可以帮助我了解我在哪里将默认版本设置为 2.1.4 吗?

我在全新安装 OS 后遇到了同样的问题,在我的终端中选择 Run command as a login shell 解决了这个问题。

Terminal > 
Edit > 
Profile Preference > 
Title and Command > 
(Check) **Run command as a login shell**
Restart Terminal

Login shells (typically when a terminal window is opened) will use .bash_profile but interactive, non-login shells reference .bashrc (likely where the rvm shell code are loaded).