How to skip evaluating a custom resource when compiling?


Recently, I am making my very first custom resource and facing a barrier that chef-client run fails due to the custom resource that requires/depends on a gem package that also depends on a deb package when compiling. There are chef_gem and apt_package in the recipe to install those dependencies but it fails in advance at the custom resource when compiling. I have been searching for how to skip evaluating custom resource when compiling but could find a proper solution. I tried only_if/not_if in resource block and return key word in recipe but both did not work out. So I am going to need your help to fix this problem. Please help!


I fixed that by just moving code from action_class to action block. code in side action_class seems to be evaluated during compile_time while action block does not? action class is evaluated while compiling so it can be used by action block when converge?