In 1717ec9, @mkristian committed a patch to make dist artifacts use bin/jruby.bash for bin/jruby, but that is not sufficient to solve #990.
When the jruby-launcher gem installs, it modifies our RubyGems defaults to start using the full path to jruby in the binstubs it installs instead of using /usr/bin/env. Because in dist artifacts, the bin/jruby is a bash script, it can't be used directly in shebang lines.
system ~/projects/jruby-versions/jruby-1.7.5.dev $ bin/jruby -S gem install bundler
Fetching: bundler-1.3.5.gem (100%)
Successfully installed bundler-1.3.5
1 gem installed
system ~/projects/jruby-versions/jruby-1.7.5.dev $ head -10 bin/bundle
# This file was generated by RubyGems.
# The application 'bundler' is installed as part of a gem, and
# this file is here to facilitate running it.
system ~/projects/jruby-versions/jruby-1.7.5.dev $ bin/bundle -v
bin/bundle: line 9: require: command not found
bin/bundle: line 11: version: command not found
bin/bundle: line 15: syntax error near unexpected token `('
bin/bundle: line 15: ` str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding'
The dist artifacts need to avoid installing jruby-launcher altogether to avoid rewriting those defaults, or the defaults need to be restored in some way. The latter sounds like the simplest, and it's what our old dist logic did.
adjust bin stubs to use /usr/bin/env (using inlined ruby in pom) #1001
fixed via 5a5f63d