Fix to gems:install on JRuby

There's a patch on Lighthouse to fix gem installation on JRuby:

http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2215

Can some JRuby users take a look at it? It looks OK to me, but I don't have a JRuby install
to test on at the moment. Feedback from Windows users is particularly important - does "jruby -S gem"
work for that case?

Thanks!

--Matt Jones