# Can I use a Ruby handler in Sensu Go?

**URL:** <https://discourse.sensu.io/t/can-i-use-a-ruby-handler-in-sensu-go/1117>\
**Category:** Sensu Go\
**Created:** [March 11, 2019, 4:55pm UTC](https://discourse.sensu.io/t/can-i-use-a-ruby-handler-in-sensu-go/1117 "2019-03-11T16:55:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chgonzalez](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/chgonzalez/32/124_2.png) [@chgonzalez](https://discourse.sensu.io/u/chgonzalez)\
**Post date:** [March 11, 2019, 4:55pm UTC](https://discourse.sensu.io/t/can-i-use-a-ruby-handler-in-sensu-go/1117/1 "2019-03-11T16:55:49Z")

</div>

1. What have you already tried? Please include links to gists and/or code blocks (if relatively small)

I’m using the sensu/sensu:master image with Docker. I’m trying to integrate Sensu Go with Google Chat. I’ve found this handler [https://github.com/clevertoday/sensu-plugins-hangouts-chat](https://github.com/clevertoday/sensu-plugins-hangouts-chat) but it is written in Ruby for the 1.x version of Sensu.

Can I use this handler (or any handler writen in Ruby) with Sensu Go? Can I install a Ruby runtime inside the sensu-backend container? Or should I rewrite this handler in Go or another languaje?

1. Tell us about your setup, this should include OS, version of Sensu, version of Sensu components (redis, rabbitmq), plugin versions (if applicable), anything special about your setup such as an airgapped network or strict ACLs

Sensu go inside a Docker container using the sensu/sensu:master image.

1. Is there a Github issue related to your issue?

No.

1. Is there anything else that can help us effectively help you?

I’ve installed Ruby inside the sensu-backend container (`apk add ruby`) but when executing the handler I get this error:

```auto
/usr/local/bin # ./handler-hangouts-chat.rb 
Traceback (most recent call last):
        2: from ./handler-hangouts-chat.rb:10:in `<main>'
        1: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- sensu-handler (LoadError)

```

---

<div class="post-metadata">

**Author:** ![aaronsachs](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/aaronsachs/32/47_2.png) [@aaronsachs](https://discourse.sensu.io/u/aaronsachs)\
**Post date:** [March 11, 2019, 5:03pm UTC](https://discourse.sensu.io/t/can-i-use-a-ruby-handler-in-sensu-go/1117/2 "2019-03-11T17:03:23Z")

</div>

@chgonzalez 👋 you can install a ruby runtime via [https://docs.sensu.io/sensu-go/5.2/installation/plugins/](https://docs.sensu.io/sensu-go/5.2/installation/plugins/) . Ideally, the handler would be rewritten in Go so that it could be packaged as an asset, which would eliminate the need for installing the Ruby runtime and having to deal with any sort of PATH screwiness.

---

<div class="post-metadata">

**Author:** ![chgonzalez](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/chgonzalez/32/124_2.png) [@chgonzalez](https://discourse.sensu.io/u/chgonzalez)\
**Post date:** [March 15, 2019, 4:01pm UTC](https://discourse.sensu.io/t/can-i-use-a-ruby-handler-in-sensu-go/1117/3 "2019-03-15T16:01:03Z")

</div>

So I must install a ruby runtime **inside** the sensu-backend container?

It seems that sensu/sensu:latest is based on Alpine image. There isn’t an Alpine package in PackageCloud. Should I copy the instructions from [https://github.com/sensu/sensu-ruby-runtime/blob/master/Dockerfile.alpine](https://github.com/sensu/sensu-ruby-runtime/blob/master/Dockerfile.alpine) and add it to my custom sensu-backend Dockerfile?

---

<div class="post-metadata">

**Author:** ![palourde](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/palourde/32/60_2.png) [@palourde](https://discourse.sensu.io/u/palourde)\
**Post date:** [March 26, 2019, 1:54pm UTC](https://discourse.sensu.io/t/can-i-use-a-ruby-handler-in-sensu-go/1117/4 "2019-03-26T13:54:20Z")

</div>

Yes, in order to run Ruby scripts, you’ll need a Ruby runtime within your container. You should be able to use the same Dockerfile.alpine you found without any problem!
