Ice
Ice

Reputation: 314

NoMethodError: undefined method `connect' for Chef::Resource::File

i am trying learn chef automation following the tutorial on the website

https://learn.chef.io/learn-the-basics/rhel/configure-a-resource/

centos 7 both 0.10 and 0.09 version gave me this error when i tried to follow the exercise its simple but i am getting following error.

[ i am trying chef for the first so really have no idea what i am doing ,anyone can give me any hints or suggestion it be helpful ]

[root@centos-7 chef-repo]# chef-apply hello.rb
[2015-11-25T04:29:27-05:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2015-11-25T04:29:27-05:00] FATAL: NoMethodError: undefined method `connect' for Chef::Resource::File
[root@centos-7 chef-repo]# cat /var/chef/cache/chef-stacktrace.out
Generated at 2015-11-25 04:29:27 -0500
NoMethodError: undefined method `connect' for Chef::Resource::File
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/resource.rb:1576:in `method_missing'
hello.rb:2:in `block in run_chef_recipe'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/resource_builder.rb:77:in `instance_eval'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/resource_builder.rb:77:in `build'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/dsl/recipe.rb:108:in `build_resource'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/dsl/recipe.rb:69:in `declare_resource'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/dsl/resources.rb:15:in `file'
hello.rb:1:in `run_chef_recipe'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/application/apply.rb:186:in `instance_eval'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/application/apply.rb:186:in `run_chef_recipe'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/application/apply.rb:198:in `run_application'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/application/apply.rb:211:in `run'
/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/bin/chef-apply:25:in `<top (required)="">'
/usr/bin/chef-apply:54:in `load'
/usr/bin/chef-apply:54:in `<main>'[root@centos-7 chef-repo]#

Upvotes: 0

Views: 529

Answers (1)

coderanger
coderanger

Reputation: 54249

If I had to guess you typo'd content as connect.

Upvotes: 2

Related Questions