A private `open 'method called Chef :: Provider :: File: Class

I am trying to create a resource that writes all attributes to a file.

gist provider

gist resource

I get the following error:

Error executing action runon resource 'ruby_block [dump_node_attributes]' '

NoMethodError

private method `open' called for Chef::Provider::File:Class

Cookbook Trace:

/Users/odedpriva/.chef/local-mode-cache/cache/cookbooks/test-helper/providers/create.rb:24:in `block (3 levels) in class_from_file'

Any idea what I'm doing wrong?

+4
source share
1 answer

In your block do this ::File.open. Unfortunately, this is necessary because of the implicit relative search for Ruby characters. The leader ::leads him to be a symbol of aboslute, like a leader /on the road.

+7
source

All Articles