Hi CHEF Experts,
I've been running perfectly well on Chef client 12 and am currently going through an upgrade to Chef client 14. When trying to converge my cookbook against a test kitchen VM with Chef: 14.14.25, I am now getting one "NoMethodError" error after another. In my helper library file, at the end of the file, I used to be able to just have the following code:
Chef::Recipe.send(:include, My::Helper) Chef::Resource.send(:include, My::Helper) Chef::Node.send(:include, My::Helper) if defined?(Chef::Node)
Just by having the three lines of code above, I was able to access my helper libraries anywhere within my cookbook. From custom resources, recipes, attribute files... anywhere... However, as of Chef client 14, this seems to no longer be the case...
I tried changing
Chef::Resource.send(:include, My::Helper) to
Chef::Resource::RubyBlock.send(:include, My::Helper) and had some luck, but I'm still running into more and more issues with the "NoMethodError" error.
Is there any way to get my helper libraries to be globally exported again like they were with Chef 12?
Greatly appreciate any feedback/help anyone can provide... thanks!