Me neither, I am totally unfamilar with bundler, I just needed to crack on and found that using system worked, hence my post, but since bundler sets up the environment in which things should run, I suspect Kernel exec maybe important.

May be worth cross posting to JRuby guys as they are very helpful and maybe an issue with Kernel exec ?

This issue occurs with all bundle exec commands followed by multiple arguments using JRuby on Windows. For example bundle exec rake assets:compile fails, but bundle exec "rake assets:precompile" (quoted) works fine.

The more I look at Kernel API the more I think it is a JRuby problem, because it is behaving differently from Ruby MRI on the same platform. I think the intent of bundle exec must be to call Kernel.exec(*ARGV), and replace the bundle process with the target command in the same shell, instead of opening a subshell. At least that is my interpretation...

Here's the gist I created that day. It was a pretty simple test of creating a Rakefile and trying to execute it with Bundler. It did raise an entirely different error than in 1.6.7.2. I just compiled and ran with master and received the same error.