mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
Detect ruby engine
This commit is contained in:
parent
9e0f981d9e
commit
95ba70d9b9
1 changed files with 3 additions and 3 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
basedir=$(cd `dirname $0`/..; pwd)
|
||||
if [ -d "$basedir/.git" ] ; then
|
||||
RUBY=${RUBY=jruby}
|
||||
RUBY=${RUBY=$(ruby -e 'puts RUBY_ENGINE')}
|
||||
RUBYVER=${RUBYVER=1.9}
|
||||
export GEM_HOME="$basedir/vendor/bundle/${RUBY}/${RUBYVER}"
|
||||
export GEM_PATH=
|
||||
|
@ -12,10 +12,10 @@ export RUBYLIB="$basedir/lib"
|
|||
|
||||
which ruby > /dev/null 2>&1
|
||||
if [ "$?" -eq 0 -a -z "$USE_JRUBY" ] ; then
|
||||
ruby "$basedir/lib/logstash/runner.rb" "$@"
|
||||
exec ruby "$basedir/lib/logstash/runner.rb" "$@"
|
||||
else
|
||||
# No ruby found, fetch JRuby and run.
|
||||
jruby="vendor/jar/jruby-complete-1.7.3.jar"
|
||||
[ ! -f "$jruby" ] && make build-jruby
|
||||
java -jar "$jruby" "$basedir/lib/logstash/runner.rb" "$@"
|
||||
exec java -jar "$jruby" "$basedir/lib/logstash/runner.rb" "$@"
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue