以上第一次不起作用,第二次起作用.

对于任何新的shell窗口,try 将ruby版本设置为2.0.0.

$ rvm use 2.0.0 --default

给予

Warning! PATH is not properly set up, '/home/durrantm/.rvm/gems/ruby-1.9.3-p125/
bin' is not at first place,
         usually this is caused by shell initialization files - check them for '
PATH=...' entries,
         it might also help to re-add RVM to your dotfiles: 'rvm get stable --au
to-dotfiles',
         to fix temporarily in this shell session run: 'rvm use ruby-1.9.3-p125'
.
Using /home/durrantm/.rvm/gems/ruby-2.0.0-p247

然后做同样的事

$ rvm use 2.0.0 --default

now 给予 no error, i.e.

$ rvm use 2.0.0 --default
Using /home/durrantm/.rvm/gems/ruby-2.0.0-p247
durrantm.../durrantm$ 

但新的windows仍在为我提供ruby 1.9.3,而不是2.0.0

我的.bashrc文件中有:

PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
[[ -s "/home/durrantm/.rvm/scripts/rvm" ]] && . "/home/durrantm/.rvm/scripts/rvm"

我的bash_的个人资料包括:

source ~/.profile
case $- in *i*) . ~/.bashrc;; esac

try

rvm get stable

似乎有效,但在许多绿色输出的末尾显示:

Could not update RVM, get some help at #rvm IRC channel at freenode servers.

带有rvm list rubies个窗口的新终端显示:

$ rvm list rubies
Warning! PATH is not properly set up, '/home/durrantm/.rvm/gems/ruby-1.9.3-p125/bin' is not at first place,
         usually this is caused by shell initialization files - check them for 'PATH=...' entries,
         it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
         to fix temporarily in this shell session run: 'rvm use ruby-1.9.3-p125'.

rvm rubies

=> ruby-1.9.3-p125 [ x86_64 ]
   ruby-1.9.3-p194 [ x86_64 ]
 * ruby-2.0.0-p247 [ x86_64 ]

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

推荐答案

答案是:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" 
# Load RVM into a shell session *as a function*

**at the BOTTOM**(最后一行-重要!)我的.bashrc文件.我把它放在口袋里了.bash_概要文件(我在Ubuntu上),这只起到了部分作用,导致了令人困惑的错误.

Ruby相关问答推荐

类 SpecificationPolicy 的超类不匹配

删除带括号的子表达式

Symfony 2assets资源过滤器异常中的指南针

为什么 Rake 不能连续调用多个任务?

Sinatra 与 EventMachine WebSockets 一起工作是否成功?

define_method:如何动态创建带参数的方法

Ruby 哈希文字的顺序是否得到保证?

jekyll 调试或打印所有变量

使用 Homebrew 安装 Ruby

确定字符串数组是否包含ruby中的某个子字符串

object_id 分配如何工作?

我不明白Ruby本地范围(local scope)

如何在 Ruby 中创建可重用的块/proc/lambda?

在 Ruby 中将散列扁平化为字符串

删除/取消定义类方法

为什么显式返回会对 Proc 产生影响?

to_proc 方法是什么意思?

让 sidekiq 立即执行作业(job)

正则表达式中的 `?i` 和 `?-i` 是什么意思?

如何在 Ruby 中创建整数循环?