我想我使用的是过时的食谱版本。而且我真的不知道运行列表是如何工作的。
要通过各自的说明书安装 rbenv 和 ruby_build,请参阅以下文件配置...
厨师档案:
site 'http://community.opscode.com/api/v1'
cookbook 'rbenv', :git => 'https://github.com/fnichol/chef-rbenv', :ref => 'master'
cookbook 'ruby_build', :git => 'https://github.com/fnichol/chef-ruby_build', :ref => 'master'
确保librarian-chef install
在更新 Cheffile 后
网站食谱/my_cookbook/recipes/default.rb:
depends 'ruby_build'
depends 'rbenv'
节点/dna.json:
{
"rbenv": {
"rubies":["1.9.3-p484"],
"global":"1.9.3-p484",
"gems":{
"1.9.3-p484":[
{"name": "bundler"},
{"name":"rails", "version": "4.0.2"},
{"name": "rake", "version": "10.1.1"}
]
}
},
"run_list":[
"ruby_build", // required by "rbenv::system"
"rbenv::system", // installs rubies and gems from dna, takes a while to finish the first time; see configuration options at https://github.com/fnichol/chef-rbenv#attributes
"my_cookbook::default"
]
}
按照食谱文档node.default["var_name"] = "value_name"
的建议在食谱中设置这些配置变量对我不起作用。