title: How do I install dependencies for a chef handler?
body: <p>I am trying to install a chef handler via the chef_handler lwrp.  This handler (chef-handler-email) comes bundled in a gem.  I am trying to install the gem then turn on the handler from within a single recipe that looks like:</p>
  
  <pre><code>chef_gem "chef-handler-mail"
  
  chef_handler "MailHandler" do
    source 'chef/handler/mail'
    arguments :to_address =&gt; "root"
    action :nothing
    supports :exception =&gt; true, :report =&gt; false
  end.run_action(:enable)
  </code></pre>
  
  <p>This works fine if the gem is already installed.  However, if the Gem is not already installed I receive this error:</p>
  
  <pre><code>[2012-12-09T20:47:56-05:00] FATAL: LoadError: chef_handler[MailHandler] (chef_handler::email line 13) had an error: LoadError: no such file to load -- chef/handler/mail.rb
  </code></pre>
  
  <p>It appears as though the chef_handler resource is trying to load the handler before chef_gem has executed and installed the gem for the handler.  I can obviously do this in a two step manual process where I have a separate recipe for installing the gem, then flip over to another recipe that configures the handler, but I'm hoping to avoid multi-step manual processes.  Can it be done via single recipe?</p>