Java Errors with jRuby on Rails on Google App Engine

Posted by John Wang on Stack Overflow See other posts from Stack Overflow or by John Wang
Published on 2010-04-08T20:03:36Z Indexed on 2010/04/08 21:33 UTC
Read the original article Hit count: 722

I followed all of the instructions so far from: http://code.google.com/p/appengine-jruby/wiki/RunningRails and http://gist.github.com/268192

Currently, I'm just trying to get to hello world. I'm getting these errors when I just run the dev_appserver.rb

238:hello-world jwang392$ dev_appserver.rb . 

=> Booting DevAppServer 
=> Press Ctrl-C to shutdown server 
=> Generating configuration files 
2010-04-08 09:16:51.961 java[411:1707] [Java CocoaComponent 
compatibility mode]: Enabled 
2010-04-08 09:16:51.964 java[411:1707] [Java CocoaComponent 
compatibility mode]: Setting timeout for SWT to 0.100000 
Apr 8, 2010 7:17:05 PM 
com.google.appengine.tools.development.ApiProxyLocalImpl log 
SEVERE: [1270754225387000] javax.servlet.ServletContext log: Warning: 
error application could not be initialized 
org.jruby.rack.RackInitializationException: no such file to load -- 
time 
        from file:/Users/jwang392/hello-world/WEB-INF/lib/jruby- 
rack-0.9.6.jar!/jruby/rack/booter.rb:25:in `boot!' 
        from file:/Users/jwang392/hello-world/WEB-INF/lib/jruby- 
rack-0.9.6.jar!/jruby/rack/boot/rack.rb:10 
        from file:/Users/jwang392/hello-world/WEB-INF/lib/jruby- 
rack-0.9.6.jar!/jruby/rack/boot/rack.rb:1:in `load' 
        from <script>:1 
        at org.jruby.rack.DefaultRackApplicationFactory 
$4.init(DefaultRackApplicationFactory.java:169) 
        at 
org.jruby.rack.DefaultRackApplicationFactory.newErrorApplication(DefaultRac kApplicationFactory.java: 
118) 
        at 
org.jruby.rack.DefaultRackApplicationFactory.init(DefaultRackApplicationFac tory.java: 
37) 
        at 
org.jruby.rack.SharedRackApplicationFactory.init(SharedRackApplicationFacto ry.java: 
26) 
        at 
org.jruby.rack.RackServletContextListener.contextInitialized(RackServletCon textListener.java: 
40) 
        at 
org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java: 
530) 
        at org.mortbay.jetty.servlet.Context.startContext(Context.java:135) 
        at 
org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java: 
1218) 
        at 
org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java: 
500) 
        at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java: 
448) 
        at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java: 
40) 
        at 
org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java: 
117) 
        at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java: 
40) 
        at 
org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java: 
117) 
        at org.mortbay.jetty.Server.doStart(Server.java:217) 
        at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java: 
40) 
        at 
com.google.appengine.tools.development.JettyContainerService.startContainer (JettyContainerService.java: 
188) 
        at 
com.google.appengine.tools.development.AbstractContainerService.startup(Abs tractContainerService.java: 
147) 
        at 
com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerI mpl.java: 
219) 
        at com.google.appengine.tools.development.DevAppServerMain 
$StartAction.apply(DevAppServerMain.java:162) 
        at com.google.appengine.tools.util.Parser 
$ParseResult.applyArgs(Parser.java:48) 
        at 
com.google.appengine.tools.development.DevAppServerMain.<init>(DevAppServer Main.java: 
113) 
        at 
com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMa in.java: 
89) 
Caused by: org.jruby.exceptions.RaiseException: no such file to load 
-- time 
        at (unknown).new(file:/Users/jwang392/hello-world/WEB-INF/lib/jruby- 
rack-0.9.6.jar!/jruby/rack/booter.rb:25) 
        at Kernel.require(file:/Users/jwang392/hello-world/WEB-INF/lib/jruby- 
rack-0.9.6.jar!/jruby/rack/booter.rb:25) 
        at JRuby::Rack::Booter.boot!(file:/Users/jwang392/hello-world/WEB-INF/ 
lib/jruby-rack-0.9.6.jar!/jruby/rack/boot/rack.rb:10) 
        at (unknown).(unknown)(file:/Users/jwang392/hello-world/WEB-INF/lib/ 
jruby-rack-0.9.6.jar!/jruby/rack/boot/rack.rb:1) 
        at (unknown).(unknown)(file:/Users/jwang392/Dhello-world/WEB-INF/lib/ 
jruby-rack-0.9.6.jar!/jruby/rack/boot/rack.rb:1) 
        at Kernel.load(<script>:1) 
        at (unknown).(unknown)(:1) 
Apr 8, 2010 7:17:05 PM 
com.google.appengine.tools.development.ApiProxyLocalImpl log 
SEVERE: [1270754225913000] javax.servlet.ServletContext log: unable to 
create shared application instance 
org.jruby.rack.RackInitializationException: no such file to load -- 
time 
        from file:/Users/jwang392/hello-world/WEB-INF/lib/jruby- 
rack-0.9.6.jar!/jruby/rack/booter.rb:25:in `boot!' 
        from file:/Users/jwang392/hello-world/WEB-INF/lib/jruby- 
rack-0.9.6.jar!/jruby/rack/boot/rack.rb:10 
        from file:/Users/jwang392/hello-world/WEB-INF/lib/jruby- 
rack-0.9.6.jar!/jruby/rack/boot/rack.rb:1:in `load' 
        from <script>:1 
        at org.jruby.rack.DefaultRackApplicationFactory 
$4.init(DefaultRackApplicationFactory.java:169) 
        at 
org.jruby.rack.DefaultRackApplicationFactory.getApplication(DefaultRackAppl icationFactory.java: 
51) 
        at 
org.jruby.rack.SharedRackApplicationFactory.init(SharedRackApplicationFacto ry.java: 
27) 
        at 
org.jruby.rack.RackServletContextListener.contextInitialized(RackServletCon textListener.java: 
40) 
        at 
org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java: 
530) 
        at org.mortbay.jetty.servlet.Context.startContext(Context.java:135) 
        at 
org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java: 
1218) 
        at 
org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java: 
500) 
        at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java: 
448) 
        at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java: 
40) 
        at 
org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java: 
117) 
        at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java: 
40) 
        at 
org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java: 
117) 
        at org.mortbay.jetty.Server.doStart(Server.java:217) 
        at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java: 
40) 
        at 
com.google.appengine.tools.development.JettyContainerService.startContainer (JettyContainerService.java: 
188) 
        at 
com.google.appengine.tools.development.AbstractContainerService.startup(Abs tractContainerService.java: 
147) 
        at 
com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerI mpl.java: 
219) 
        at com.google.appengine.tools.development.DevAppServerMain 
$StartAction.apply(DevAppServerMain.java:162) 
        at com.google.appengine.tools.util.Parser 
$ParseResult.applyArgs(Parser.java:48) 
        at 
com.google.appengine.tools.development.DevAppServerMain.<init>(DevAppServer Main.java: 
113) 
        at 
com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMa in.java: 
89) 
Caused by: org.jruby.exceptions.RaiseException: no such file to load 
-- time 
        at (unknown).new(file:/Users/jwang392/hello-world/WEB-INF/lib/jruby- 
rack-0.9.6.jar!/jruby/rack/booter.rb:25) 
        at Kernel.require(file:/Users/jwang392/hello-world/WEB-INF/lib/jruby- 
rack-0.9.6.jar!/jruby/rack/booter.rb:25) 
        at JRuby::Rack::Booter.boot!(file:/Users/jwang392/hello-world/WEB-INF/ 
lib/jruby-rack-0.9.6.jar!/jruby/rack/boot/rack.rb:10) 
        at (unknown).(unknown)(file:/Users/jwang392/hello-world/WEB-INF/lib/ 
jruby-rack-0.9.6.jar!/jruby/rack/boot/rack.rb:1) 
        at (unknown).(unknown)(file:/Users/jwang392/hello-world/WEB-INF/lib/ 
jruby-rack-0.9.6.jar!/jruby/rack/boot/rack.rb:1) 
        at Kernel.load(<script>:1) 
        at (unknown).(unknown)(:1) 
Apr 8, 2010 7:17:05 PM 
com.google.appengine.tools.development.ApiProxyLocalImpl log 
SEVERE: [1270754225915000] javax.servlet.ServletContext log: Error: 
application initialization failed 
org.jruby.rack.RackInitializationException: unable to create shared 
application instance 
        at 
org.jruby.rack.SharedRackApplicationFactory.init(SharedRackApplicationFacto ry.java: 
39) 
        at 
org.jruby.rack.RackServletContextListener.contextInitialized(RackServletCon textListener.java: 
40) 
        at 
org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java: 
530) 
        at org.mortbay.jetty.servlet.Context.startContext(Context.java:135) 
        at 
org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java: 
1218) 
        at 
org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java: 
500) 
        at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java: 
448) 
        at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java: 
40) 
        at 
org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java: 
117) 
        at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java: 
40) 
        at 
org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java: 
117) 
        at org.mortbay.jetty.Server.doStart(Server.java:217) 
        at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java: 
40) 
        at 
com.google.appengine.tools.development.JettyContainerService.startContainer (JettyContainerService.java: 
188) 
        at 
com.google.appengine.tools.development.AbstractContainerService.startup(Abs tractContainerService.java: 
147) 
        at 
com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerI mpl.java: 
219) 
        at com.google.appengine.tools.development.DevAppServerMain 
$StartAction.apply(DevAppServerMain.java:162) 
        at com.google.appengine.tools.util.Parser 
$ParseResult.applyArgs(Parser.java:48) 
        at 
com.google.appengine.tools.development.DevAppServerMain.<init>(DevAppServer Main.java: 
113) 
        at 
com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMa in.java: 
89) 
Caused by: org.jruby.rack.RackInitializationException: no such file to 
load -- time 
        from file:/Users/jwang392/hello-world/WEB-INF/lib/jruby- 
rack-0.9.6.jar!/jruby/rack/booter.rb:25:in `boot!' 
        from file:/Users/jwang392/hello-world/WEB-INF/lib/jruby- 
rack-0.9.6.jar!/jruby/rack/boot/rack.rb:10 
        from file:/Users/jwang392/hello-world/WEB-INF/lib/jruby- 
rack-0.9.6.jar!/jruby/rack/boot/rack.rb:1:in `load' 
        from <script>:1 
        at org.jruby.rack.DefaultRackApplicationFactory 
$4.init(DefaultRackApplicationFactory.java:169) 
        at 
org.jruby.rack.DefaultRackApplicationFactory.getApplication(DefaultRackAppl icationFactory.java: 
51) 
        at 
org.jruby.rack.SharedRackApplicationFactory.init(SharedRackApplicationFacto ry.java: 
27) 
        ... 19 more 
Caused by: org.jruby.exceptions.RaiseException: no such file to load 
-- time 
        at (unknown).new(file:/Users/jwang392/hello-world/WEB-INF/lib/jruby- 
rack-0.9.6.jar!/jruby/rack/booter.rb:25) 
        at Kernel.require(file:/Users/jwang392/hello-world/WEB-INF/lib/jruby- 
rack-0.9.6.jar!/jruby/rack/booter.rb:25) 
        at JRuby::Rack::Booter.boot!(file:/Users/jwang392/hello-world/WEB-INF/ 
lib/jruby-rack-0.9.6.jar!/jruby/rack/boot/rack.rb:10) 
        at (unknown).(unknown)(file:/Users/jwang392/hello-world/WEB-INF/lib/ 
jruby-rack-0.9.6.jar!/jruby/rack/boot/rack.rb:1) 
        at (unknown).(unknown)(file:/Users/jwang392/hello-world/WEB-INF/lib/ 
jruby-rack-0.9.6.jar!/jruby/rack/boot/rack.rb:1) 
        at Kernel.load(<script>:1) 
        at (unknown).(unknown)(:1) 
The server is running at http://localhost:8080/ 

I'm at a loss at what step I may have missed. I checked my ruby version (1.8.7) and rails version (2.3.5), gem version (1.3.6) and google-appengine-0.0.10.1

ran:

sudo gem install google-appengine

curl -O http://appengine-jruby.googlecode.com/hg/demos/rails2/rails2_appengine.rb

ruby rails2_appengine.rb

sudo gem install rails_dm_datastore

sudo gem install activerecord-nulldb-adapter

put this in my config.ru file:

run lambda { |env| Rack::Response.new('Hello World!').finish }

and finally ran $ dev_appserver.rb .

© Stack Overflow or respective owner

Related posts about jruby

Related posts about google-app-engine