ruby - Chef update certain user's .bashrc -
i'm trying update users .bashrc java_home environment variable after installing jdk. strange error don't understand. here's block of code in question. node['etc']['passwd'].each |user, data| only_if {data['uid'] > 9000} jdk_dir_array = dir.entries('/usr/java/').select {|entry| file.directory? file.join('/usr/java/',entry) , !(entry =='.' || entry == '..') } jdk_dir_name = jdk_dir_array.shift file = chef::util::fileedit.new("#{data['dir']}/.bashrc") file.search_file_replace( /java_home=.*/,"java_home=/usr/java/#{jdk_dir_name}") file.write_file end the error i'm getting this: nomethoderror ------------- no resource or method named `only_if' `chef::recipe "install_jdk"' i don't understand why thinks "only_if" method of recipe when declare inside of node.each block. i should point out if put in ruby_block , hardcode path single u...