I believe that the best option would be to use
NaCl, though I don't know of anyone who has done this. Alternatively, using jRuby, you could, in theory, get it working like any Java game (though it wouldn't work with Gosu too well, compared to using a Java game library).