Oracle GlassFish Server 3.0.1 Scripting Framework Guide

ProcedureTo Use Rails Without a Database

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

  1. Open hello/config/environment.rb file in a text editor.

  2. Look for the following commented property in the file:


    #config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
  3. Uncomment the property by removing the pound (#) character from the beginning of the line.

    The line should now read as follows:


    config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
  4. Exit and save the file.

  5. Proceed to Deploying and Running a Rails Application for instructions on deploying the application to GlassFish Server.