列出ruby版本

console:~$ rvm list

rvm rubies

ruby-2.0.0-p481 [ i686 ]

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

try 使用特定版本的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,你可以:

  1. 开放式控制台
  2. Select Edit -> Profile Preferences
  3. Select 选项卡:标题和命令
  4. 复选框"将命令作为登录shell运行"
  5. 重启终端

Ruby相关问答推荐

在 Ruby 中,如何从派生类中重写同一方法的不同方法调用基类方法?

这个#divmod 方法输出这个结果是做什么的?

定义Struct时如何指定成员的类型?

是否可以在 Ruby 中使用正则表达式匹配字符串\b(退格字符)?

整数除以负数

从 ruby​​ 脚本运行另一个 ruby​​ 脚本

如何增加 ruby​​ 应用程序的堆栈大小.递归应用程序获取:堆栈级别太深(SystemStackError)

方法应该以 (?问号)结尾吗?只返回一个布尔值?

Coffeescript 中等效的 Ruby .times

将haml标签放入link_to helper

Ruby 中的方法: objects与not?

ruby datetime 中有 add_days 吗?

从 Ruby 中的字符串创建不区分大小写的正则表达式

Ruby中的每个块都可以有一行吗?

在 Ruby 中计算中位数

HAML 中 Javascript 中的 Ruby 方法

Ruby 在特定目录中运行 shell 命令

如何在 Ruby 中做标准差?

在ruby中将字符串转换为十进制数

如何判断变量是数字还是字符串?