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

ProcedureUsing Rails Without a Database

Although Rails is intended for creating database-backed web applications, this example is simple enough that it doesn't require one. In this case, you need to edit the enviroment.rb configuration file to indicate that your application does not use a database.

  1. Open <JRUBY_HOME>/samples/hello/config/environment.rb file in a text editor.

  2. Remove the pound character (#) in front of line 21 to uncomment it so that it reads as:

    config.frameworks -= [ :active_record, :active_resource, :action_mailer ]

    ActiveRecord supports database access for Rails applications. When you create model objects, you will most likely base them on ActiveRecord::Base.

  3. Save the file.