# Run Logstash with local ruby2.4

**URL:** <https://discuss.elastic.co/t/run-logstash-with-local-ruby2-4/81380>\
**Category:** Logstash\
**Created:** [April 5, 2017, 10:43pm UTC](https://discuss.elastic.co/t/run-logstash-with-local-ruby2-4/81380 "2017-04-05T22:43:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shabirmean](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@shabirmean](https://discuss.elastic.co/u/shabirmean)\
**Post date:** [April 5, 2017, 10:43pm UTC](https://discuss.elastic.co/t/run-logstash-with-local-ruby2-4/81380/1 "2017-04-05T22:43:54Z")

</div>

Hi,

I am a newbie in-terms of Ruby.

I am trying to extend the [ruby-filewatch](https://github.com/jordansissel/ruby-filewatch) library used by the [logstash-input-file](https://github.com/logstash-plugins/logstash-input-file) plugin.

For the extension I'm using the external lib - [rest-client](https://github.com/rest-client/rest-client). This external lib requires ruby 2.0 or above to run successfully.

I have made my changes in ruby-filewatch and done

**gem build filewatch.gemspec**  
**gem install filewatch-0.9.0.gem**

This installs the generated lib **filewatch-0.9.0** under my **~/.rvm/gems/ruby-2.4.0/gems** folder.

However, whenever I run logstash with - **logstash -f [CONF\_PATH]** it looks for the required libs for it input plugins inside **[LOGSTASH\_HOME]/vendor/bundle/jruby/1.9/gems**

So I copied the generated **filewatch-0.9.0** folder into the above path.

But still I get the following error:

```
LoadError: no such file to load -- rest-client
       require at org/jruby/RubyKernel.java:1040
       require at [PATH]/logstash-5.3.0/vendor/bundle/jruby/1.9/gems/polyglot-0.3.5/lib/polyglot.rb:65
        (root) at [PATH]/logstash-5.3.0/vendor/bundle/jruby/1.9/gems/filewatch-0.9.0/lib/filewatch/observing_tail.rb:2

```

**observing\_tail.rb:2** has this code :

```
require 'rest-client'

```

Can someone help me get through this issue??

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [April 5, 2017, 10:56pm UTC](https://discuss.elastic.co/t/run-logstash-with-local-ruby2-4/81380/2 "2017-04-05T22:56:32Z")

</div>

Logstash _cannot_ run with Ruby. It now has many components written in native Java, so it can only run with JRuby.

---

<div class="post-metadata">

**Author:** ![shabirmean](https://avatars.discourse-cdn.com/v4/letter/s/e5b9ba/32.png) [@shabirmean](https://discuss.elastic.co/u/shabirmean)\
**Post date:** [April 5, 2017, 11:03pm UTC](https://discuss.elastic.co/t/run-logstash-with-local-ruby2-4/81380/3 "2017-04-05T23:03:28Z")

</div>

Okay. I am NOT very familiar with the differences of JRuby and Ruby.

Can you help achieve what I am trying to do?

I have the default logstash-input-file plugin. I want to make a modification to the filewatcher library this plugin uses. The modification includes making a REST call and getting a response.  
For this purpose, I tried to use [rest-client](https://github.com/rest-client/rest-client) library.

If this is not the right one, then what's the right way to do it?

Thank You

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 3, 2017, 11:03pm UTC](https://discuss.elastic.co/t/run-logstash-with-local-ruby2-4/81380/4 "2017-05-03T23:03:48Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
