# Using Ruby C Extensions with Logstash Ruby Plugin

**URL:** <https://discuss.elastic.co/t/using-ruby-c-extensions-with-logstash-ruby-plugin/141766>\
**Category:** Logstash\
**Created:** [July 26, 2018, 12:34pm UTC](https://discuss.elastic.co/t/using-ruby-c-extensions-with-logstash-ruby-plugin/141766 "2018-07-26T12:34:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![env070](https://avatars.discourse-cdn.com/v4/letter/e/5f8ce5/32.png) [@env070](https://discuss.elastic.co/u/env070)\
**Post date:** [July 26, 2018, 12:34pm UTC](https://discuss.elastic.co/t/using-ruby-c-extensions-with-logstash-ruby-plugin/141766/1 "2018-07-26T12:34:52Z")

</div>

Hello,

I have a Ruby C extension which I've created with the following tutorial: [https://en.wikibooks.org/wiki/Ruby\_Programming/C\_Extensions](https://en.wikibooks.org/wiki/Ruby_Programming/C_Extensions)

It works perfectly when I create the Makefile with the Ruby installed on my machine (ruby 2.3.1p112 (2016-04-26) [x86\_64-linux-gnu]).

After 'mkmf' creates the Makefile, I'm able to 'make' the .so file and require it with ruby installed on my machine.

But when I try to require it with the Logstash 'irb' I get the following error with a stack trace:

```
irb(main):001:0> require '/path/to/point.so'
LoadError: no such file to load -- /path/to/point
        from org/jruby/RubyKernel.java:955:in `require'
        from /usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
        from (irb):1:in `<eval>'
        from org/jruby/RubyKernel.java:994:in `eval'
        from org/jruby/RubyKernel.java:1292:in `loop'
        from org/jruby/RubyKernel.java:1114:in `catch'
        from org/jruby/RubyKernel.java:1114:in `catch'
        from /usr/share/logstash/logstash-core/lib/logstash/runner.rb:464:in `start_shell'
        from /usr/share/logstash/logstash-core/lib/logstash/runner.rb:282:in `execute'
        from /usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/clamp-0.6.5/lib/clamp/command.rb:67:in `run'
        from /usr/share/logstash/logstash-core/lib/logstash/runner.rb:238:in `run'
        from /usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/clamp-0.6.5/lib/clamp/command.rb:132:in `run'
        from /usr/share/logstash/lib/bootstrap/environment.rb:73:in `<main>'

```

I also tried to start the Logstash with the '--path.plugins' but it gave me this error message:  
`Logstash stopped processing because of an error: (NameError) '@path.plugins' is not allowable as an instance variable name`

Is it possible to require .so files with Logstash Ruby at all or can I require the C extension with some other technique?

Best Regards

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [July 26, 2018, 12:49pm UTC](https://discuss.elastic.co/t/using-ruby-c-extensions-with-logstash-ruby-plugin/141766/2 "2018-07-26T12:49:14Z")

</div>

Logstash uses JRuby, so I do not think that is possible.

---

<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:** [August 23, 2018, 12:49pm UTC](https://discuss.elastic.co/t/using-ruby-c-extensions-with-logstash-ruby-plugin/141766/3 "2018-08-23T12:49:16Z")

</div>

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