当我尝试在厨师食谱中使用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
中的示例答案 0 :(得分:0)
正确的语法是
environment({ 'VAR' => 'whatever' })
或
environment 'VAR' => 'whatever'