列出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.

当前回答

您的控制台不是作为登录shell运行的,因此不能访问rvm功能。如果你正在运行Ubuntu,你可以:

打开控制台 选择“Edit -> Profile Preferences” 选择页签:标题和命令 复选框“作为登录shell运行命令” 重启终端

其他回答

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

source ~/.rvm/scripts/rvm

在~/.bashrc的末尾

输入bash——从终端登录。然后给rvm使用2.0.0

以下工作为我在ubuntu 19.1

source ~/.rvm/scripts/rvm

您的控制台不是作为登录shell运行的,因此不能访问rvm功能。如果你正在运行Ubuntu,你可以:

打开控制台 选择“Edit -> Profile Preferences” 选择页签:标题和命令 复选框“作为登录shell运行命令” 重启终端

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

source ~/.rvm/scripts/rvm