I download it at https://www.elastic.co/downloads/logstash. And test it in CentOS 7.0. The JRE's version is 1.8.0_101. When I run ./bin/logstash agent -f config/log4j_to_es.conf it prints:

Unable to find JRuby.
If you are a user, this is a bug.
If you are a developer, please run 'rake bootstrap'. Running 'rake' requires the 'ruby' program be available.

I download the TAR.GZ package. I don't know how to fix it.


I have found something really interesting relating to this error, where we see the following error: Unable to find JRuby.

In short, it turned out for me that the TAR.GZ file was incompletely unpacked.

I had a .tar.gz file and used tar -xzf command to extract its contents into a filesystem directory. What was missing was the following directory: logstash-5.5.2/vendor/jruby

I then found out that my server's filesystem was out of space, hence only partial TAR.GZ extraction happened. When I cleared up the filesystem, and unpacked the logstash archive, everything works! Happy days!

| improve this answer | |

In a tarballed installation, jruby exists under the vendor folder. Make sure it exists. The logstash command you're running is basically a shell script, which sources a lib file bin/logstash.lib.sh

Also, try running in debug mode:

export DEBUG=1
./bin/logstash --help

The likely culprit is:

  • you've set JAVA_HOME, which means you're using the OS java.
  • you've accidentally set the USE_RUBY environment variable
| improve this answer | |
  • I run export JAVACMD=which java`` and I print the JAVA_HOME /usr/java/jdk1.8.0_101/bin. So it seems right. Then I print the USE_RUBY and get nothing. – blackdog Sep 26 '16 at 3:33
  • Having checked the shell, I can't find jruby in vender. How can I fix it? – blackdog Sep 26 '16 at 3:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.