I'm trying to create a resource that writes all attributes to a file.
provider gist
resource gist
Error executing action run
on 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 am I doing wrong?
In your block, make that ::File.open
. Unfortunately this is required because of Ruby's implicit relative symbol lookups. The leading ::
forces it to be an aboslute symbol, like a leading /
in a path.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With