ruby - Chef default nginx recipe - TypeError cant convert symbol to integer -



ruby - Chef default nginx recipe - TypeError cant convert symbol to integer -

i next peepcode chef tutorial. created next nginx default.rb file -

package "nginx" service "nginx" supports :status => true, :restart => true, :reload => true action[ :enable, :start] end template "/etc/nginx/nginx.conf" notifies :reload, "service[nginx]" end

i run chef-solo -j /etc/chef/node.json , next error -

typeerror --------- can't convert symbol integer cookbook trace: --------------- /cookbooks/nginx/recipes/default.rb:5:in `[]' /cookbooks/nginx/recipes/default.rb:5:in `block in from_file' /cookbooks/nginx/recipes/default.rb:3:in `from_file' relevant file content: ---------------------- /cookbooks/nginx/recipes/default.rb: 1: bundle "nginx" 2: 3: service "nginx" 4: supports :status => true, :restart => true, :reload => true 5>> action[ :enable, :start] 6: end 7: 8: template "/etc/nginx/nginx.conf" 9: notifies :reload, "service[nginx]" 10: end 11:

i think tutorial uses chef 10, have installed chef 11. there simple syntax error i'm missing or has changed v10 v11?

some more info -

this runlist file - -

{ "run_list" : ["recipe[nginx]"] }

and stacktrace got -

generated @ 2014-06-22 14:40:20 +0200 typeerror: can't convert symbol integer /cookbooks/nginx/recipes/default.rb:5:in `[]' /cookbooks/nginx/recipes/default.rb:5:in `block in from_file' /usr/local/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/dsl/recipe.rb:123:in `instance_eval' /usr/local/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/dsl/recipe.rb:123:in `build_resource' /usr/local/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/dsl/recipe.rb:86:in `declare_resource' /usr/local/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/dsl/recipe.rb:42:in `method_missing' /cookbooks/nginx/recipes/default.rb:3:in `from_file' /usr/local/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/mixin/from_file.rb:30:in `instance_eval' /usr/local/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/mixin/from_file.rb:30:in `from_file' /usr/local/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/cookbook_version.rb:237:in `load_recipe' /usr/local/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context.rb:165:in `load_recipe' /usr/local/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context/cookbook_compiler.rb:140:in `block in compile_recipes' /usr/local/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context/cookbook_compiler.rb:138:in `each' /usr/local/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context/cookbook_compiler.rb:138:in `compile_recipes' /usr/local/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context/cookbook_compiler.rb:75:in `compile' /usr/local/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context.rb:88:in `load' /usr/local/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/policy_builder/expand_node_object.rb:73:in `setup_run_context' /usr/local/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:265:in `setup_run_context' /usr/local/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:429:in `do_run' /usr/local/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:213:in `block in run' /usr/local/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:207:in `fork' /usr/local/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:207:in `run' /usr/local/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application.rb:217:in `run_chef_client' /usr/local/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application/solo.rb:221:in `block in run_application' /usr/local/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application/solo.rb:213:in `loop' /usr/local/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application/solo.rb:213:in `run_application' /usr/local/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application.rb:67:in `run' /usr/local/lib/ruby/gems/1.9.1/gems/chef-11.12.8/bin/chef-solo:25:in `<top (required)>' /usr/local/bin/chef-solo:19:in `load'

i couldn't access peepcode tutorial if have created nginx cookbook seems may need space in between action , [:enable, :start] in line specified in error. (nginx default recipe line 5) see http://docs.opscode.com/resource_service.html#examples

ruby nginx gem chef

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

c# - Create a Notification Object (Email or Page) At Run Time -- Dependency Injection or Factory -

Set Up Of Common Name Of SSL Certificate To Protect Plesk Panel -