# mailer.rb error

**URL:** <https://discourse.sensu.io/t/mailer-rb-error/410>\
**Category:** Sensu Classic (EOL)\
**Created:** [March 31, 2015, 6:44pm UTC](https://discourse.sensu.io/t/mailer-rb-error/410 "2015-03-31T18:44:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akshay\_Kapoor](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@Akshay\_Kapoor](https://discourse.sensu.io/u/Akshay_Kapoor)\
**Post date:** [March 31, 2015, 6:44pm UTC](https://discourse.sensu.io/t/mailer-rb-error/410/1 "2015-03-31T18:44:54Z")

</div>

Adithya,

that got resolved because using **gem install mail** install the gem on the system wide ruby whereas sensu might be using EMBEDDED\_RUBY. You can check that in your /etc/defaults/sensu config

Installing with **/opt/sensu/embedded/bin/gem install mail** fixed it because it installed the gem in sensu’s path and thus makes it available for sensu handlers requiring the same.

-Akshay

> **···**
>
> On Tuesday, March 24, 2015 at 1:37:53 AM UTC-7, Adithya Khamithkar wrote:
> 
> > I have using mailer.rb for my sensu to send out emails but it failed and I keep getting this error in logs.
> > 
> > {“timestamp”:“2015-03-24T13:53:07.779780+0530”,“level”:“info”,“message”:“handler output”,“handler”:{“type”:“pipe”,“command”:“/opt/sensu/embedded/bin/ruby /etc/sensu/handlers/mailer.rb -j ‘/etc/sensu/conf.d/mailer.json’”,“name”:“default”},“output”:[“/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/mixlib-cli-1.5.0/lib/mixlib/cli.rb:191:in `parse_options': invalid option: -j (OptionParser::InvalidOption)\n","\tfrom /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-plugin-1.1.0/lib/sensu-handler.rb:16:in `initialize’\n”,“\tfrom /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-plugin-1.1.0/lib/sensu-handler.rb:52:in `new'\n","\tfrom /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-plugin-1.1.0/lib/sensu-handler.rb:52:in `block in class:Handler’\n”,“/opt/sensu/embedded/lib/ruby/2.0.0/rubygems/core\_ext/kernel\_require.rb:53:in `require': cannot load such file -- mail (LoadError)\n","\tfrom /opt/sensu/embedded/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:53:in `require’\n”,“\tfrom /etc/sensu/handlers/mailer.rb:19:in `<main>'\n"]} {"timestamp":"2015-03-24T13:53:07.783175+0530","level":"info","message":"handler output","handler":{"type":"pipe","command":"/opt/sensu/embedded/bin/ruby /etc/sensu/handlers/mailer.rb -j '/etc/sensu/conf.d/mailer.json'","name":"default"},"output":["/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/mixlib-cli-1.5.0/lib/mixlib/cli.rb:191:in `parse\_options’: invalid option: -j (OptionParser::InvalidOption)\n”,“\tfrom /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-plugin-1.1.0/lib/sensu-handler.rb:16:in `initialize'\n","\tfrom /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-plugin-1.1.0/lib/sensu-handler.rb:52:in `new’\n”,“\tfrom /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-plugin-1.1.0/lib/sensu-handler.rb:52:in `block in <class:Handler>'\n","/opt/sensu/embedded/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:53:in `require’: cannot load such file – mail (LoadError)\n”,“\tfrom /opt/sensu/embedded/lib/ruby/2.0.0/rubygems/core\_ext/kernel\_require.rb:53:in `require'\n","\tfrom /etc/sensu/handlers/mailer.rb:19:in `'\n”]}
> 
> > ``
> 
> > Can some one help me fix this?
> > 
> > Thanks,
