我尝试将此 Play2 食谱添加到与 Vagrant 一起运行的食谱列表中,但这样做时vagrant provision
出现错误
FATAL: Gem::InstallError: chef_gem[rubyzip] (play2::default line 20) had an error: Gem::InstallError: rubyzip requires Ruby version >= 1.9.2.
所以我使用了另一个安装了 Ruby 1.9.3 的 basebox:
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "precise64-ruby1.9.3"
# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
config.vm.box_url = "https://dl.dropbox.com/u/14292474/vagrantboxes/precise64-ruby-1.9.3-p194.box"
但是,使用 Vagrant 进行配置仍然会出现相同的错误。而且盒子确实使用了Ruby 1.9.3:
$ vagrant ssh
Welcome to Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-23-generic x86_64)
* Documentation: https://help.ubuntu.com/
Welcome to your Vagrant-built virtual machine.
Last login: Sun Aug 19 22:42:58 2012 from 10.0.2.2
vagrant@precise64:~$ ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
在通过 SSH 连接到Vagrantgem install rubyzip
机器后,一切正常。为什么vagrant provision
在这里不起作用?