Bugs: Browse | Submit New | Admin

[#26821] Error when running rack app

Date:
2009-08-01 16:43
Priority:
3
Submitted By:
John Lloyd-Jones (johnlloydjones)
Assigned To:
Nobody (None)
Category:
grizzly
State:
Closed
Target Release:
 
Summary:
Error when running rack app

Detailed description
I get this the 0.95 glassfish gem when I try to run a simple hello world rack application.

com.sun.grizzly.jruby.rack.RackInitializationException: uninitialized constant Rack::VERSION

Needs something like this:
module Rack
   VERSION = '1.0'
end

Also, more of a doc issue, but to get a sample app to run you need both the following lines:

require 'rack/handler/grizzly'
require 'jruby/rack/grizzly_helper'

Add A Comment: Notepad

Please login


Followup

Message
Date: 2009-10-30 23:25
Sender: Vivek Pandey

This is fixed in the latest trunk. Now there is no need to require
any grizzly classes. Pure rack applications are just going to
work. Here is an interim build that you can try:

http://download.java.net/maven/glassfish/org/glassfish/scripting/
glassfish-gem/0.9.6-SNAPSHOT/glassfish-gem-0.9.6-SNAPSHOT.gem.

Here is the simple rack application that just works fine:

config.ru
-------
require 'hello'

use HelloWorld
run HelloWorld

hello.rb
------
class HelloWorld
  def initialize(app, mime_types=%w[text/html])
  end
  
  def call(env)
    [200, {"Content-Type" => "text/html"},
["Hello world!"]]
  end
end

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

Field Old Value Date By
status_idOpen2009-10-30 23:25vivekp
resolution_idNone2009-10-30 23:25vivekp
category_idNone2009-10-30 23:25vivekp
artifact_group_idNone2009-10-30 23:25vivekp
close_date2009-10-30 23:252009-10-30 23:25vivekp