To install the GlassFish v3 Gem on your JRuby standalone instance, use the following procedure:
Download and install JRuby according to the instructions in To Install JRuby as Standalone.
Install Rails Gem according to the instructions in To Install Rails Gem on JRuby
Run the Gem installer to install the GlassFish v3 Gem:
jruby -S gem install glassfish
Start your server with the following command:
jruby -S glassfish