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

Ubuntu: JRuby startup warning #5635

Closed
SgtBalogh opened this issue Feb 28, 2019 · 6 comments
Closed

Ubuntu: JRuby startup warning #5635

SgtBalogh opened this issue Feb 28, 2019 · 6 comments
Milestone

Comments

@SgtBalogh
Copy link

Environment

  • JRuby version (jruby -v) and command line (flags, JRUBY_OPTS, etc)
    jruby 9.2.0.0 (2.5.0) 2018-05-24 81156a8 OpenJDK 64-Bit Server VM 25.191-b12 on 1.8.0_191-8u191-b12-0ubuntu0.16.04.1-b12 +jit [linux-x86_64]

  • Operating system and platform (e.g. uname -a)
    Linux osboxes 4.15.0-42-generic Log wrapper #45~16.04.1-Ubuntu SMP Mon Nov 19 13:02:27 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Other relevant info you may wish to add:

  • Installed or activated gems
    Rails gems

  • Application/framework version (e.g. Rails, Sinatra)
    Rails 5.2.2

  • Environment variables

Expected Behavior

JRuby 9.2.6 works fine in Linux, thanks for this great software. However we get the attached error during startup. What are we doing wrong?

  • Describe your expectation of how JRuby should behave, perhaps by showing how CRuby/MRI behaves.
    Just not print that error :)

  • Provide an executable Ruby script or a link to an example repository.

Actual Behavior

/home/osboxes/Applications/jruby-9.2.6.0/bin/jruby.sh /home/osboxes/Documents/workspaceRuby/kubarails/bin/rails server -b 0.0.0.0 -p 3000 -e development
/home/osboxes/Applications/jruby-9.2.6.0/bin/jruby.sh: 118: [: /home/osboxes/Applications/jruby-9.2.6.0/lib/jruby.jar: unexpected operator
/home/osboxes/Applications/jruby-9.2.6.0/bin/jruby.sh: 121: [: /home/osboxes/Applications/jruby-9.2.6.0/lib/jruby.jar: unexpected operator
/home/osboxes/Applications/jruby-9.2.6.0/bin/jruby.sh: 260: /home/osboxes/Applications/jruby-9.2.6.0/bin/jruby.sh: [[: not found
/home/osboxes/Applications/jruby-9.2.6.0/bin/jruby.sh: 283: [: missing ]
/home/osboxes/Applications/jruby-9.2.6.0/bin/jruby.sh: 283: /home/osboxes/Applications/jruby-9.2.6.0/bin/jruby.sh: : Permission denied

Thanks in advance.

All the best,

Hardy

@enebo
Copy link
Member

enebo commented Feb 28, 2019

@SgtBalogh as a test can you try to change top line of jruby.sh to:

#!/bin/bash

I am guessing this script has some bash syntax and your /bin/sh is being stricter...

@SgtBalogh
Copy link
Author

@enebo: Thank you for your prompt response.
It just works (a little bit), but there are still these errors:

/home/osboxes/Applications/jruby-9.2.6.0/bin/jruby.sh /home/osboxes/Documents/workspaceRuby/kubarails/bin/rails console -- --prompt simple
/home/osboxes/Applications/jruby-9.2.6.0/bin/jruby.sh: line 283: [: missing `]'
/home/osboxes/Applications/jruby-9.2.6.0/bin/jruby.sh: line 283: : command not found
Loading development environment (Rails 5.2.2)

This is line 283 im my jruby.sh:
if [ "$NO_BOOTCLASSPATH" != "" || "$VERIFY_JRUBY" != "" ]; then
if [ "$PROFILE_ARGS" != "" ]; then
echo "Running with instrumented profiler"
fi

Thanks again

Greetings from Munich

Hardy

@enebo
Copy link
Member

enebo commented Mar 1, 2019

Interesting...I can repro this as well. bin/jruby itself is our main shell script but seemingly bin/jruby.sh introduced some bashism and seemingly an error even in sh. We will fix this. For now I recommend bin/jruby itself.

./bin/jruby.sh -e 1
./bin/jruby.sh: line 283: [: missing `]'
./bin/jruby.sh: line 283: : command not found

@enebo enebo added this to the JRuby 9.2.7.0 milestone Mar 1, 2019
enebo added a commit that referenced this issue Mar 1, 2019
@enebo
Copy link
Member

enebo commented Mar 1, 2019

@SgtBalogh I am having a hard time getting to see the initial problems with the script but I think it is because:

ls -l /bin/sh
0 lrwxrwxrwx. 1 root root 4 Jan 17 02:27 /bin/sh -> bash*

After 7c7362a the scripts runs for me...

@SgtBalogh
Copy link
Author

Hello @enebo
we had vacations here in Bavaria. Thanks alot for fixing this. Sorry for the late reply. Works perfectly fine now.

Greetings from sunny Munich

Hardy

@enebo
Copy link
Member

enebo commented Mar 20, 2019

@SgtBalogh ok good to hear! Greetings from partly cloudy Minneapolis :P

@enebo enebo closed this as completed Mar 20, 2019
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

2 participants