【问题标题】:Chef LWRPs - how to useChef LWRP - 如何使用
【发布时间】:2012-10-10 18:50:47
【问题描述】:

我尝试使用 chef 来制作 Vagrant 的开发环境。 当我运行vagrant provision 时,我无法在 rbenv 中安装 rubies 版本。我使用gem librarian 下载食谱,这是我当前的 Vagrantfile : https://github.com/rhacker/vagrant-rails/blob/master/Vagrantfile

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

【问题讨论】:

    标签: chef-infra


    【解决方案1】:

    创建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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-11-07
      • 2013-11-29
      • 1970-01-01
      • 1970-01-01
      • 2023-03-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多