我正在使用带有 Berkshelf 插件的 Vagrant 创建一个 Ubuntu 12.04 机器,默认使用 Ruby 2.0.0-p247。机器加载时,ruby -v
返回ruby 1.8.7 (2012-02-08 patchlevel 358) [x86_64-linux]
,表示 rbenv 没有安装正确的版本。
另外,如果我尝试rbenv global 2.0.0-p247
收到错误rbenv: version
2.0.0-p247' not installed`
任何想法我做错了什么?
谢谢
流浪文件:
config.berkshelf.enabled = true
config.omnibus.chef_version = :latest
config.vm.provision :shell, :inline => "gem install chef --no-rdoc --no-ri --conservative"
config.vm.provision :chef_solo do |chef|
chef.add_recipe "apt"
chef.add_recipe "git"
chef.add_recipe "build-essential"
chef.add_recipe "ruby_build"
chef.add_recipe "rbenv::vagrant"
chef.add_recipe "rbenv::system"
chef.json = {
'rbenv' => {
'user_installs' => [
{
'user' => 'vagrant',
'rubies' => ['2.0.0-p247'],
'global' => '2.0.0-p247',
'gems' => {
'2.0.0-p247' => [
{ 'name' => 'bundler' },
{ 'name' => 'rake' }
]
}
}
]
}
}
end
伯克斯文件:
site :opscode
cookbook 'apt'
cookbook 'git'
cookbook 'build-essential'
cookbook 'ruby_build'
cookbook 'rbenv', git: 'git://github.com/fnichol/chef-rbenv.git', ref: "v0.7.2"