ruby - Got "undefined method `[]' for nil:NilClass" installing java Cookbook -
i try set vagrant vm using chef solo , berkshelf. want use maven cookbook. "maven" depends on "java" , "java_ark" (which included in "java" cookbook). of them created opscode.
but everytime error:
nomethoderror ------------- undefined method `[]' nil:nilclass cookbook trace: --------------- /tmp/vagrant-chef-1/chef-solo-1/cookbooks/java/recipes/default.rb:21:in `from_file' /tmp/vagrant-chef-1/chef-solo-1/cookbooks/platform-slayer/recipes/slayer_worker.rb:2:in `from_file' relevant file content: ---------------------- /tmp/vagrant-chef-1/chef-solo-1/cookbooks/java/recipes/default.rb: 14: # unless required applicable law or agreed in writing, software 15: # distributed under license distributed on "as is" basis, 16: # without warranties or conditions of kind, either express or implied. 17: # see license specific language governing permissions , 18: # limitations under license. 19: # 20: 21>> include_recipe "java::#{node['java']['install_flavor']}" 22: 23: # purge deprecated sun java packages if remove_deprecated_packages true 24: %w[sun-java6-jdk sun-java6-bin sun-java6-jre].each |pkg| 25: package pkg 26: action :purge 27: only_if { node['java']['remove_deprecated_packages'] } 28: end 29: end 30:
does know issue? let me know if need anymore information.
i think problem node['java']
evaluating nil
.
one possible solution define attribute node['java']['install_flavor']
either in cookbook or in node definition or relevant role definition.
but looks bug in cookbook, because documentation says default should apply install_flavor
attribute.
Comments
Post a Comment