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

当前回答

您需要添加源~/。Rvm /scripts/ Rvm到~/。your_shellrc文件。从现在开始,当你加载一个shell时,rvm将被加载。

例如:

如果你使用的是ZSH shell,需要添加~/。zshrc中

如果您使用bash shell,需要添加~/。bashrc文件(

然后打开一个新标签,看看效果。

其他回答

FWIW-我只是遇到了这个,它是在取消硒运行的上下文中。也许有一个子shell正在被实例化并留在原地。我所要做的就是关闭终端窗口,打开一个新的窗口。(macOS山脉)

我的环境是OSX优胜美地。有同样的问题....通过添加以下内容来解决

1)编辑并添加以下一行到.bash_profile文件。

[[-s "$HOME/。Rvm /scripts/ Rvm "]] &&。“$ HOME / .rvm /脚本/区”

2)重启终端,重试RVM命令

以下工作为我在ubuntu 19.1

source ~/.rvm/scripts/rvm

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

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

您需要添加源~/。Rvm /scripts/ Rvm到~/。your_shellrc文件。从现在开始,当你加载一个shell时,rvm将被加载。

例如:

如果你使用的是ZSH shell,需要添加~/。zshrc中

如果您使用bash shell,需要添加~/。bashrc文件(

然后打开一个新标签,看看效果。