列出ruby版本

console:~$ rvm list

rvm rubies

ruby-2.0.0-p481 [ i686 ]

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

尝试使用特定版本的ruby

console:~$ rvm use 2.0.0

RVM is not a function, selecting rubies with 'rvm use ...' will not work.

You need to change your terminal emulator preferences to allow login shell.
Sometimes it is required to use `/bin/bash --login` as the command.
Please visit https://rvm.io/integration/gnome-terminal/ for a example.

当前回答

如果你不想每次打开一个终端都这样,再做一遍上面的建议,只需添加

source ~/.rvm/scripts/rvm

在~/.bashrc的末尾

其他回答

看起来你的rvm没有加载”。bash_profile正确”。我已经在MAC OS X或Ubuntu 14.04中通过打开终端来修复它,并写道:

source ~/.rvm/scripts/rvm

以下工作为我在ubuntu 19.1

source ~/.rvm/scripts/rvm

如果RVM安装了专用的ubuntu RVM安装程序https://github.com/rvm/ubuntu_rvm, RVM脚本的路径将不同于/usr/share/rvm/scripts/rvm.因此,要将它添加到你的.bashrc中,运行以下命令:

echo 'source "/usr/share/rvm/scripts/rvm"' >> ~/.bashrc

从新的Ubuntu 16.04安装

1)终端=>编辑=>配置文件首选项

2) Command Tab =>检查作为登录shell的Run命令

3)关闭终端,重新打开终端

rvm --default use 2.2.4

如果你不想每次打开一个终端都这样,再做一遍上面的建议,只需添加

source ~/.rvm/scripts/rvm

在~/.bashrc的末尾