Rubygem: fix raising of CommandError for #install

Fix issue #870 (gem-install seems broken on jruby)