Oracle GlassFish Server 3.0.1 Scripting Framework Guide

ProcedureTo Run a Rails Application on GlassFish v3 Gem

You can also run your JRuby on Rails application on the embedded GlassFish v3 Gem. Create a simple Rails application as described in Creating a Simple Rails Application. Instead of deploying it to the GlassFish Server, use the GlassFish v3 Gem to run that application as described in the following task.

  1. Change to the directory where a sample application has been created. For example:


    cd /jruby-apps
    
  2. Deploy the previously created hello application:


    jruby -S glassfish helloV3
    
  3. Run the application using the following URL in your web browser:


    http://localhost:3000/home/index

    You should now see the following message in your browser window:


    Welcome to JRuby on Rails on the Oracle GlassFish Server!

    Note that the GlassFish v3 Gem runs on port 3000 and not the default port 8080.