我一直在嘗試使用Vagrant測試一些我的食譜。我已經能夠毫無問題地設置我的Vagrant框,但每次嘗試設置時都會失敗(或者在Vagrantfile中指定的cookbooks目錄執行vagrant up
)。流浪和自定義廚師資源
出於某種原因,它似乎試圖編譯目錄中的每一本食譜(不管它是否在運行列表中使用),它對我的自定義資源不滿意。他們每個人都與同樣的錯誤失敗:
SyntaxError
-----------
compile error
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/expect/resources/script.rb:5: syntax error, unexpected ':', expecting $end
attribute :script, kind_of: String, required: true
^
它在這個例子中抱怨自定義資源是:
actions :create
default_action :create
attribute :script, kind_of: String, required: true
我Vagrantfile的相關部分是:
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "/Users/0x783czar/Development/Work/Chef-Repos/chef2/cookbooks"
chef.roles_path = "/Users/0x783czar/Development/Work/Chef-Repos/chef2/roles"
chef.data_bags_path = "/Users/0x783czar/Development/Work/Chef-Repos/chef2/data_bags"
chef.add_recipe "build-essential"
chef.add_recipe "mongodb"
# You may also specify custom JSON attributes:
# chef.json = { :mysql_password => "foo" }
end
我和Chef-Solo一起使用了同樣的食譜&資源,沒有遇到任何問題,所以我很困惑。這既是爲什麼它試圖編譯我甚至沒有用過的食譜,也不知道爲什麼它無法編譯自定義資源。
我使用的是 「流浪1.0.5」, 上 「的Mac OS X 10.8」, 用 「的VirtualBox 4.2.4」, 這個流浪漢構建使用 「廚師獨奏10.14.2」
哦,讓這麼多的意義創建自己的流浪者中,謝客 –
另外,Opscode公司發佈大廚從「總括安裝基礎箱「安裝程序(包括他們自己的Ruby 1.9.3)在我們的」Bento「項目之外:https://github.com/opscode/bento - 自述文件有鏈接到下載的baseboxes。 – jtimberman