有一个奇怪的问题,因为我有一个Rake任务,它似乎正在使用Ruby的多个版本。当一个失败,它似乎尝试另一个。
详细信息
我不完全确定错误的具体细节,但因为这可能是Veewee本身的一个问题。所以,我想要做的是在veewee定义的基础上构建一个新的盒子。这个命令失败了,并出现了一个关于缺少方法的错误--但有趣的是它是如何失败的。
错误
我设法发现,如果我只在RVM中安装了一个Ruby,它就会失败。如果我有一个以上的Ruby安装,它在同一个地方失败,但是在另一个解释器中执行似乎还在继续。
以下是两种不同的剪裁控制台输出。我剪了它们的尺寸。每个错误的全部输出都是作为要旨。
安装了一个Ruby版本
下面是在RVM中只有一个版本的Ruby (1.8.7)可用时运行的命令
boudica:veewee john$ rvm rake build['mettabox'] --trace
rvm 1.1.0 by Wayne E. Seguin (wayneeseguin@gmail.com) [http://rvm.beginrescueend.com/]
(in /Users/john/Work/veewee)
** Invoke build (first_time)
** Execute build
…
creating new harddrive
rake aborted!
undefined method `max_vdi_size' for #<VirtualBox::SystemProperties:0x102d6af80>
/Users/john/.rvm/gems/ruby-1.8.7-p302/gems/virtualbox-0.8.3/lib/virtualbox/abstract_model/dirty.rb:172:in `method_missing'
<------ stacktraces cut ---------->
/Users/john/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/bin/rake:31
/Users/john/.rvm/gems/ruby-1.8.7-p302@global/bin/rake:19:in `load'
/Users/john/.rvm/gems/ruby-1.8.7-p302@global/bin/rake:19多个Ruby版本
下面是在RVM中使用的三个版本的Ruby运行的相同命令。在此之前,我使用了"rvm使用1.8.7“。同样,我不知道具体错误的细节有多重要--我感兴趣的是有三个单独的错误--每个错误都有自己的堆栈跟踪--每个错误都在不同的Ruby解释器中。查看每个堆栈跟踪的底部,您将看到它们都来自不同的解释器位置--首先是ree-1.8.7,然后是ruby-1.8.7,然后是ruby-1.9.2:
boudica:veewee john$ rvm rake build['mettabox'] --trace
rvm 1.1.0 by Wayne E. Seguin (wayneeseguin@gmail.com) [http://rvm.beginrescueend.com/]
(in /Users/john/Work/veewee)
** Invoke build (first_time)
** Execute build
…
creating new harddrive
rake aborted!
undefined method `max_vdi_size' for #<VirtualBox::SystemProperties:0x1059dd608>
/Users/john/.rvm/gems/ree-1.8.7-2010.02/gems/virtualbox-0.8.3/lib/virtualbox/abstract_model/dirty.rb:172:in `method_missing'
…
/Users/john/.rvm/gems/ree-1.8.7-2010.02/gems/rake-0.8.7/bin/rake:31
/Users/john/.rvm/gems/ree-1.8.7-2010.02@global/bin/rake:19:in `load'
/Users/john/.rvm/gems/ree-1.8.7-2010.02@global/bin/rake:19
(in /Users/john/Work/veewee)
** Invoke build (first_time)
** Execute build
isofile ubuntu-10.04.1-server-amd64.iso is available
["a1b857f92eecaf9f0a31ecfc39dee906", "30b5c6fdddbfe7b397fe506400be698d"]
[]
Last good state: -1
Current step: 0
last good state -1
destroying machine+disks
(re-)executing step 0-initial-a1b857f92eecaf9f0a31ecfc39dee906
VBoxManage: error: Machine settings file '/Users/john/VirtualBox VMs/mettabox/mettabox.vbox' already exists
VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component Machine, interface IMachine, callee nsISupports
Context: "CreateMachine(bstrSettingsFile.raw(), name.raw(), osTypeId.raw(), Guid(id).toUtf16().raw(), FALSE , machine.asOutParam())" at line 247 of file VBoxManageMisc.cpp
rake aborted!
undefined method `memory_size=' for nil:NilClass
/Users/john/Work/veewee/lib/veewee/session.rb:303:in `create_vm'
/Users/john/Work/veewee/lib/veewee/session.rb:166:in `build'
/Users/john/Work/veewee/lib/veewee/session.rb:560:in `transaction'
/Users/john/Work/veewee/lib/veewee/session.rb:163:in `build'
/Users/john/Work/veewee/Rakefile:87
/Users/john/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/Users/john/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/Users/john/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/lib/rake.rb:631:in `each'
…
/Users/john/.rvm/gems/ruby-1.8.7-p302/gems/rake-0.8.7/bin/rake:31
/Users/john/.rvm/gems/ruby-1.8.7-p302@global/bin/rake:19:in `load'
/Users/john/.rvm/gems/ruby-1.8.7-p302@global/bin/rake:19
(in /Users/john/Work/veewee)
** Invoke build (first_time)
** Execute build
isofile ubuntu-10.04.1-server-amd64.iso is available
["a9c4ab3257e1da3479c984eae9905c2a", "30b5c6fdddbfe7b397fe506400be698d"]
[]
Last good state: -1
Current step: 0
last good state -1
(re-)executing step 0-initial-a9c4ab3257e1da3479c984eae9905c2a
VBoxManage: error: Machine settings file '/Users/john/VirtualBox VMs/mettabox/mettabox.vbox' already exists
VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component Machine, interface IMachine, callee nsISupports
Context: "CreateMachine(bstrSettingsFile.raw(), name.raw(), osTypeId.raw(), Guid(id).toUtf16().raw(), FALSE , machine.asOutParam())" at line 247 of file VBoxManageMisc.cpp
rake aborted!
undefined method `memory_size=' for nil:NilClass
/Users/john/Work/veewee/lib/veewee/session.rb:303:in `create_vm'
/Users/john/Work/veewee/lib/veewee/session.rb:166:in `block in build'
/Users/john/Work/veewee/lib/veewee/session.rb:560:in `transaction'
/Users/john/Work/veewee/lib/veewee/session.rb:163:in `build'
/Users/john/Work/veewee/Rakefile:87:in `block in <top (required)>'
/Users/john/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rake.rb:634:in `call'
/Users/john/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rake.rb:634:in `block in execute'
…
/Users/john/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rake.rb:2013:in `top_level'
/Users/john/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rake.rb:1992:in `run'
/Users/john/.rvm/rubies/ruby-1.9.2-p0/bin/rake:35:in `<main>'直到我们到达最后一个已安装的Ruby版本,执行才停止。
讨论
有人知道这是怎么回事吗?以前有人见过这种“故障转移”-like行为吗?在我看来,第一个异常不会像对一个解释器那样停止执行,但我不知道在安装RVM时是否发生了我们Ruby开发人员没有考虑的事情。
发布于 2011-02-04 14:23:42
您提到的错误不是不同的ruby问题。因为新的流浪者需要它,所以你可以升级到Virtualbox 4.X吗?
veewee依赖的virtualbox的一些功能(尚未)被移植到Virtualbox 4.x
我现在通过直接执行virtualbox命令来解决这个问题。有趣的是,在实现更新时,我碰到了完全相同的错误。
帕特里克(维维鼓吹者)
https://stackoverflow.com/questions/4838452
复制相似问题