Getting Started With JRuby on Rails for Sun GlassFish Enterprise Server v3 Prelude

ProcedureCreating the Rails Application That Accesses Java Libraries

  1. Go to <JRUBY_HOME>/samples.

  2. Create an application by running this command:

    jruby -S rails imageprocess
  3. Open the <JRUBY_HOME>/samples/imageprocess/config/environment.rb file in a text editor.

  4. Follow steps 2 and 3 from the instructions in section, Using Rails Without a Database.

  5. Go to the <JRUBY_HOME>/samples/imageprocess directory you just created.

  6. Create a controller and default view for the application by running this command:

    jruby script/generate controller home index
  7. Go to the <JRUBY_HOME>/samples/imageprocess/app/views/home directory.

  8. Create a second view by copying the default view into a view called seeimage.html.erb:

    cp index.html.erb seeimage.html.erb