awm
awm

Reputation: 1200

Unexpected tASSOC, in a chef recipe. What's wrong?

I keep getting the an error when I try to use the environment attribute in a chef recipe:

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

The error is :

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

I copied the example from the chef docs here

Upvotes: 1

Views: 1733

Answers (1)

StephenKing
StephenKing

Reputation: 37600

The correct syntax would be either

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

or

environment 'VAR' => 'whatever'

Upvotes: 1

Related Questions