Skip to content

Instantly share code, notes, and snippets.

@nicksieger
Created March 15, 2012 16:20
Show Gist options
  • Save nicksieger/2045059 to your computer and use it in GitHub Desktop.
Save nicksieger/2045059 to your computer and use it in GitHub Desktop.
JRuby launcher script to use in Warbler war files
#!/bin/sh
#
# Simple script to launch JRuby using the components embedded in a war created by Warbler.
# Tell Warbler to put this script in /WEB-INF with this config/warble.rb code:
#
# config.webinf_files += FileList["jruby.sh"]
#
HERE=`dirname $0`
GEM_HOME=$HERE/gems
GEM_PATH=$HERE/gems
PATH=$PATH:$GEM_HOME/bin
CLASSPATH=
for jar in $HERE/lib/*.jar; do
if [ "$CLASSPATH" ]; then
CLASSPATH="$CLASSPATH:$jar"
else
CLASSPATH="$jar"
fi
done
# Launch JRuby using java
java -Xmx512m -cp $CLASSPATH org.jruby.Main "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment