The repo that you pointed to only has a module named ‘updated_resources.rb’, so your require statement should reflect this (unless the gem has a completely different filename, which I doubt).
A quick suggestion that might make things easier for you. One good pattern for using chef_handler is:
- Write your handler. In this case you’ve already got @jtimberman’s to start with.
- Drop the file with the contents of the handler into ./chef-repo/cookbooks/chef_handler/files/default/handlers/<handler_name>.rb
- Declare the ‘chef_handler’ resource inside of ./chef-repo/cookbooks/chef_handler/recipes/default.rb
- Prefix your run_list with the handler, or at least ensure it runs before any of the recipes in the run_list that use the handler.
For a more thorough treatment of handlers (in case my explanation isn’t enough), have a look here: http://wiki.opscode.com/display/chef/Distributing+Chef+Handlers
Hope this helps.
On Wednesday, August 8, 2012 at 2:25 PM, Sachin Sagar Rai wrote:
I tried to use custom-handler with chef-servers, I mean not chef-solo, and in particular this https://github.com/jtimberman/chef-handler-updated-resources simple one by @jtimberman
But it errors out everytime.
Following is the recipe ( I tried with different ways):
# r = gem_package "chef-handler-updated-resources" do
# action :nothing
# require 'chef-handler-updated-resources'
chef_handler "SimpleReport::UpdatedResources" do
But always errors out. The -l debug is here: https://gist.github.com/3296700
Whats wrong with
require "chef-handler-updated-resources" ???
~ Sachin Sagar Rai
Ruby on Rails Developer
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)