Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logstash 6.1.1 issue with setup.bat file "could not find jruby in" #8901

Open
cjlyons81 opened this issue Dec 29, 2017 · 8 comments
Open

Logstash 6.1.1 issue with setup.bat file "could not find jruby in" #8901

cjlyons81 opened this issue Dec 29, 2017 · 8 comments
Assignees

Comments

@cjlyons81
Copy link

  • Version: Logstash 6.1.1
  • Operating System: Windows 2012 R2
  • Config File (if you have sensitive info, please remove it): N/A
  • Sample Data: N/A
  • Steps to Reproduce: Call any batch file that leverages setup.bat (i.e. logstash.bat, logstash-plugin.bat, etc..)

Error message produced when executing the bat files:

The system cannot find the path specified.
"could not find jruby in C:\Program Files\Elastic\Logstash\6.1.1\vendor\jruby"

Within the setup.bat file the %JRUBY_BIN% validation step is leveraging double quotes around the %JRUBY_BIN% variable. This apparently works fine with the 'exist' statement but when you negate with 'not' things don't seem to work . I assume this was just a simple miss as the %JAVA% validation step is not leveraging double quotes.

Does not work:

set JRUBY_BIN="%LS_HOME%\vendor\jruby\bin\jruby"
if not exist "%JRUBY_BIN%" (
echo "could not find jruby in %LS_HOME%\vendor\jruby" 1>&2
exit /b 1
)

Works just fine:

set JRUBY_BIN="%LS_HOME%\vendor\jruby\bin\jruby"
if not exist %JRUBY_BIN% (
echo "could not find jruby in %LS_HOME%\vendor\jruby" 1>&2
exit /b 1
)

@drazde
Copy link

drazde commented Jan 5, 2018

Ok, the previus error is fixed with @cjlyons81 solution,
but seem there is analog error now I have the error below; seem there is a problem with a path with space...

FINDSTR: Impossibile aprire C:\Program
FINDSTR: Impossibile aprire Files\Elastic\Logstash\config\jvm.options

So I change this line in logstash.bat

for /F "usebackq delims=" %%a in (findstr /b \- "%LS_JVM_OPTIONS_CONFIG%") do set options=!options! %%a

with

for /F "usebackq delims=" %%a in (findstr /b \- "%LS_JVM_OPTIONS_CONFIG%") do set options=!options! %%a

But I have another error:

"warning: no jvm.options file found"
Bundler::GemfileNotFound: C:/Program Files/Elastic/Logstash/Gemfile not found
       build at C:/Program Files/Elastic/Logstash/vendor/bundle/jruby/2.3.0/gems/bundler-1.9.10/lib/bundler/definition.rb:22
  definition at C:/Program Files/Elastic/Logstash/vendor/bundle/jruby/2.3.0/gems/bundler-1.9.10/lib/bundler.rb:155
       setup at C:/Program Files/Elastic/Logstash/vendor/bundle/jruby/2.3.0/gems/bundler-1.9.10/lib/bundler.rb:118
      setup! at C:/Program Files/Elastic/Logstash/lib/bootstrap/bundler.rb:57
      <main> at C:\Program Files\Elastic\Logstash\lib\bootstrap\environment.rb:63

@iano123
Copy link

iano123 commented Jan 8, 2018

It cannot handle a space in the path. Just move your logstash to c:\logstash and it is fine

@jordansissel
Copy link
Contributor

@andrewvc can you take/delegate this? I'm hoping it's a small fix (allowing spaces in the parent path of Logstash on Windows)

@andrewvc
Copy link
Contributor

andrewvc commented Jan 9, 2018

@colinsurprenant can you take a look at this issue?

@colinsurprenant
Copy link
Contributor

I have fixed locally the startup scripts but I am hitting some more problems in the code itself - working on it.

@colinsurprenant
Copy link
Contributor

Ok, PR in #8931

@colinsurprenant
Copy link
Contributor

This is merged and will be fixed in 6.1.3 and up.

@ismailraju
Copy link

ismailraju commented Sep 13, 2023

in Logstash 7.17.12 also give ""could not find jruby in \logstash-7.17.12\vendor\jruby""
jdk :11

then i use Logstash vs 7.17.13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants