# Use ruby 2 for jruby

**URL:** <https://discuss.elastic.co/t/use-ruby-2-for-jruby/82129>\
**Category:** Logstash\
**Created:** [April 12, 2017, 9:38am UTC](https://discuss.elastic.co/t/use-ruby-2-for-jruby/82129 "2017-04-12T09:38:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![codenamelxl](https://avatars.discourse-cdn.com/v4/letter/c/ad7895/32.png) [@codenamelxl](https://discuss.elastic.co/u/codenamelxl)\
**Post date:** [April 12, 2017, 9:38am UTC](https://discuss.elastic.co/t/use-ruby-2-for-jruby/82129/1 "2017-04-12T09:38:07Z")

</div>

I'm trying to write a plugin for logstash. My plugin uses a library that require ruby 2+ to run. After searching around, i found that JRuby 1.7 can support Ruby 2.x. How can i force logstash jruby to use ruby 2.0.  
Thanks everyone.

---

<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 12, 2017, 2:36pm UTC](https://discuss.elastic.co/t/use-ruby-2-for-jruby/82129/2 "2017-04-12T14:36:21Z")

</div>

Have you tried simply requiring the module?

```auto
require "module"

```

And seeing what happens?

---

<div class="post-metadata">

**Author:** ![codenamelxl](https://avatars.discourse-cdn.com/v4/letter/c/ad7895/32.png) [@codenamelxl](https://discuss.elastic.co/u/codenamelxl)\
**Post date:** [April 12, 2017, 4:04pm UTC](https://discuss.elastic.co/t/use-ruby-2-for-jruby/82129/3 "2017-04-12T16:04:40Z")

</div>

Yes , i did. As reported here  
[https://github.com/dasch/avro\_turf/issues/61](https://github.com/dasch/avro_turf/issues/61) . I also did some research here and suspect that because ruby 1.9 does not support named arguments.  
I also see that Logstash is having a plan to move to JRuby 9k which due in logstash 5.4. I will switch to that later.Now, I just need some way to force JRuby to use RUby 2.0 which is probably possible here: [http://stackoverflow.com/questions/15281036/how-to-run-ruby-2-0-with-jruby-1-7](http://stackoverflow.com/questions/15281036/how-to-run-ruby-2-0-with-jruby-1-7).  
However, Logstash complain when i try to do that.  
Thanks 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 10, 2017, 4:05pm UTC](https://discuss.elastic.co/t/use-ruby-2-for-jruby/82129/4 "2017-05-10T16:05:30Z")

</div>

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