rvm重置默认值

时间:2013-01-01 08:53:18

标签: ruby rvm

这些是我用RVM安装的红宝石

rvm rubies

   ruby-1.8.7-head [ x86_64 ]
   ruby-1.9.2-p290 [ x86_64 ]
   ruby-1.9.3-rc1 [ x86_64 ]

我有很多1.9.2的宝石集

gemsets for ruby-1.9.2-p290 (found in /Users/mm/.rvm/gems/ruby-1.9.2-p290)
   19332
   309
   clone
   devise
   devise311
   enki
   global
   rails3
   rails301
   rails303
   rails304
   rails310
   rails313
   rails32
   rails323
   rails3tutorial
   railsValim

但是,当我尝试使用其中一个时,它说它不存在

rvm use 1.9.2@rails304
ERROR: Gemset 'rails304' does not exist, rvm gemset create 'rails304' first.
WARN: Gemset doesn't exist, proceeding with default gemset
WARN: ruby ruby-1.9.2-use1.9.2 is not installed.
To install do: 'rvm install ruby-1.9.2-use1.9.2'

请注意最后一行中对Ruby版本的引用

To install do: 'rvm install ruby-1.9.2-use1.9.2'

这与上面列出的红宝石不同

ruby-1.9.2-p290 [ x86_64 ]

我不知道最后Ruby的'use1.9.2'来自哪里。也许我通过尝试做rvm use 1.9.2这样的事情搞砸了所以“使用”这个词与1.9.2一起被粘在了一起,所以我试着将另一个rvm ruby​​(p290)设置为默认值

rvm use ruby-1.9.2-p290 --default
Using /Users/me/.rvm/gems/ruby-1.9.2-p290

但是当我这样做并试图使用它的一个宝石时,它说它不存在

rvm use 1.9.2@rails304
ERROR: Gemset 'rails304' does not exist, rvm gemset create 'rails304' first.
WARN: Gemset doesn't exist, proceeding with default gemset
WARN: ruby ruby-1.9.2-use1.9.2 is not installed.
To install do: 'rvm install ruby-1.9.2-use1.9.2'

再一次,它引用了另一个ruby版本'ruby-1.9.2-use.1.9.2',结尾有趣的'use.1.9.2'。

我不知道这是我的人为错误,还是我最近安装的Mountain Lion导致的问题,导致我的计算机上出现了一些其他系统更改。

如何从我的系统中获取'ruby-1.9.2-use.1.9.2'并使用我执行命令时列出的ruby 1.9.2 rvm rubies

       ruby-1.8.7-head [ x86_64 ]
       ruby-1.9.2-p290 [ x86_64 ]
       ruby-1.9.3-rc1 [ x86_64 ]

2 个答案:

答案 0 :(得分:2)

我不知道为什么同义词“rvm use 1.9.2”停止工作并显示出如此奇怪的行为但是 假设使用rubie work的确切名称,您可以尝试像这样指定gemset

rvm use ruby-1.9.2-p290@rails304

或设置为默认

rvm use ruby-1.9.2-p290@rails304 --default

答案 1 :(得分:1)

以下是了解rvm use

行为的一些信息

当您运行rvm list known时,它将按以下格式列出红宝石:

[ruby-]1.9.2[-p320]
[ruby-]1.9.3-p125
[ruby-]1.9.3-p194
[ruby-]1.9.3-p286
[ruby-]1.9.3-p327
[ruby-]1.9.3[-p362]

[]中包含的部分是可选的输入。因此,执行rvm use 1.9.3会尝试使用1.9.3-p362,因为它被认为是最好的1.9.3版本。如果您没有安装它,它会要求您先安装它。这意味着,当您安装ruby-1.9.2时,它可能安装了p290,因为它是最新版本,并且在将RVM升级到更新版本后不再是这种情况。因此,要将gemsets用于已安装的版本,您需要执行rvm use ruby-1.9.2-p290@GEMSET