gpt4 book ai didi

chef-infra - Chef LWRPs - 如何使用

转载 作者:行者123 更新时间:2023-12-02 08:45:26 24 4
gpt4 key购买 nike

我尝试过使用 chef 来制作带有 Vagrant 的开发环境。 当我运行 vagrant provision 时,我遇到了在 rbenv 中安装 rubies 版本的问题。我使用 gem librarian 下载 Recipe ,这是我当前的 Vagrantfile : https://github.com/rhacker/vagrant-rails/blob/master/Vagrantfile

这是我存储 Cheffile 和 Vagrantfile 的存储库:https://github.com/rhacker/vagrant-rails

最佳答案

创建 site-cookbooks/rbenv/recipes/install.rb
include_recipe "rbenv::default"
include_recipe "rbenv::ruby_build"

rbenv_ruby "1.9.3-p194"

现在在你的 Vagrantfile 中,更改为

Vagrant::Config.run do |config|
config.vm.box = "lucid32"
config.vm.network :hostonly, "33.33.33.33"
config.vm.customize do |vm|
vm.memory_size = 386
end
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = ["cookbooks", "site-cookbooks"]
chef.add_recipe "apt"
chef.add_recipe "build-essential"
chef.add_recipe "git"
chef.add_recipe "openssl"
chef.add_recipe "postgresql"
chef.add_recipe "rbenv::install"
chef.add_recipe "unicorn"
end
end

关于chef-infra - Chef LWRPs - 如何使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12826311/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com