# Sensu-embedded Ruby vs system Ruby

**URL:** <https://discourse.sensu.io/t/sensu-embedded-ruby-vs-system-ruby/258>\
**Category:** Sensu Classic (EOL)\
**Created:** [September 23, 2014, 12:41am UTC](https://discourse.sensu.io/t/sensu-embedded-ruby-vs-system-ruby/258 "2014-09-23T00:41:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Florin\_Andrei](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/florin_andrei/32/674_2.png) [@Florin\_Andrei](https://discourse.sensu.io/u/Florin_Andrei)\
**Post date:** [September 23, 2014, 12:41am UTC](https://discourse.sensu.io/t/sensu-embedded-ruby-vs-system-ruby/258/1 "2014-09-23T00:41:11Z")

</div>

First time installing Sensu. It seems like I need to make a choice now for the route I want to take with the plugins. Either use the Ruby embedded in Sensu, or use the system Ruby.

I’ve downloaded this plugin:

[https://github.com/sensu/sensu-community-plugins/blob/master/plugins/system/cpu-mpstat-metrics.rb](https://github.com/sensu/sensu-community-plugins/blob/master/plugins/system/cpu-mpstat-metrics.rb)

If I use the system Ruby, I get these errors:

# ./cpu-mpstat-metrics.rb

/usr/lib/ruby/1.9.1/rubygems/custom\_require.rb:36:in `require’: cannot load such file – sensu-plugin/metric/cli (LoadError)

```
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'

from ./cpu-mpstat-metrics.rb:10:in `<main>'

```

If I edit the plugin to use the Ruby embedded in Sensu, I get this:

# ./cpu-mpstat-metrics.rb

Sensu::Plugin::CLI: [“Not implemented! You should override Sensu::Plugin::CLI#run.”]

/opt/sensu/embedded/lib/ruby/2.0.0/rubygems/core\_ext/kernel\_require.rb:53:in `require’: cannot load such file – linux/kstat (LoadError)

```
from /opt/sensu/embedded/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:53:in `require'

from ./cpu-mpstat-metrics.rb:12:in `<main>'

```

Either way, various components are missing, and I need to install them. But it seems to me that, if I pick one Ruby and start installing things into it, I should stick to it from now on.

What’s the generally recommended in this situation?

---

<div class="post-metadata">

**Author:** ![Kyle\_Anderson](https://avatars.discourse-cdn.com/v4/letter/k/e5b9ba/32.png) [@Kyle\_Anderson](https://discourse.sensu.io/u/Kyle_Anderson)\
**Post date:** [September 23, 2014, 3:16pm UTC](https://discourse.sensu.io/t/sensu-embedded-ruby-vs-system-ruby/258/2 "2014-09-23T15:16:06Z")

</div>

It is up to you and your environment.

One reason I personally like to use the embedded ruby is that it  
allows me to have a consistent version of a modern ruby across all my  
platforms. (boo Ruby 1.8.5)

But if you are not super familiar with how gems work, it is very easy  
to apt-get install rubygem-bla and have it work on the system ruby. It  
is up to you.

> **···**
>
> On Mon, Sep 22, 2014 at 5:41 PM, Florin Andrei \<florin.andrei@gmail.com\> wrote:
> 
> > First time installing Sensu. It seems like I need to make a choice now for  
> > the route I want to take with the plugins. Either use the Ruby embedded in  
> > Sensu, or use the system Ruby.
> > 
> > I've downloaded this plugin:
> > 
> > [https://github.com/sensu/sensu-community-plugins/blob/master/plugins/system/cpu-mpstat-metrics.rb](https://github.com/sensu/sensu-community-plugins/blob/master/plugins/system/cpu-mpstat-metrics.rb)
> > 
> > If I use the system Ruby, I get these errors:
> > 
> > # ./cpu-mpstat-metrics.rb  
> > /usr/lib/ruby/1.9.1/rubygems/custom\_require.rb:36:in `require': cannot load  
> > such file -- sensu-plugin/metric/cli (LoadError)  
> > from /usr/lib/ruby/1.9.1/rubygems/custom\_require.rb:36:in `require'  
> > from ./cpu-mpstat-metrics.rb:10:in `\<main\>'
> > 
> > If I edit the plugin to use the Ruby embedded in Sensu, I get this:
> > 
> > # ./cpu-mpstat-metrics.rb  
> > Sensu::Plugin::CLI: ["Not implemented! You should override  
> > Sensu::Plugin::CLI#run."]  
> > /opt/sensu/embedded/lib/ruby/2.0.0/rubygems/core\_ext/kernel\_require.rb:53:in  
> > `require': cannot load such file -- linux/kstat (LoadError)  
> > from  
> > /opt/sensu/embedded/lib/ruby/2.0.0/rubygems/core\_ext/kernel\_require.rb:53:in  
> > `require'  
> > from ./cpu-mpstat-metrics.rb:12:in `\<main\>'
> > 
> > Either way, various components are missing, and I need to install them. But  
> > it seems to me that, if I pick one Ruby and start installing things into it,  
> > I should stick to it from now on.
> > 
> > What's the generally recommended in this situation?
