Skip to content

Commit e5fa991

Browse files
committed
Add an error for running jruby.sh from a broken JRUBY_HOME
If bin/jruby.sh is located within a JRUBY_HOME that is incomplete (such as a freshly-checked-out repository) it will fail when it tries to access an unset JRUBY_CP variable. This patch detects the missing lib/jruby.jar and terminates the script early rather than letting it fail with a cryptic shell error. See jruby#9216
1 parent f21870a commit e5fa991

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

bin/jruby.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,11 @@ for j in "$JRUBY_HOME"/lib/jruby.jar "$JRUBY_HOME"/lib/jruby-complete.jar; do
671671
fi
672672
jruby_jar="$j"
673673
done
674+
675+
if [ -z "${jruby_jar-}" ]; then
676+
echo "JRUBY_HOME at ${JRUBY_HOME} contains no lib/jruby.jar, exiting."
677+
exit 1
678+
fi
674679
readonly jruby_jar
675680

676681
if $cygwin; then

0 commit comments

Comments
 (0)