意外的tASSOC,在厨师食谱中。怎么了?

时间:2015-06-10 15:18:50

标签: ruby vagrant chef

当我尝试在厨师食谱中使用environment属性时,我一直收到错误:

git name do
        repository repo_url 
        revision "master"
        environment  { 'VAR' => 'whatever' }
        action :sync
      end

错误是:

ERROR: /tmp/vagrant-chef-3/chef-solo-3/cookbooks/JandJ/recipes/git_repo.rb:11: syntax error, unexpected tASSOC, expecting '}'
==> default:            environment  { 'VAR' => 'whatever' }

我复制了主厨文档here

中的示例

1 个答案:

答案 0 :(得分:0)

正确的语法是

environment({ 'VAR' => 'whatever' })

environment 'VAR' => 'whatever'