Ошибки Java с помощью jRuby on Rails в Google App Engine - PullRequest
3 голосов
/ 09 апреля 2010

Я следовал всем инструкциям так далеко от: http://code.google.com/p/appengine-jruby/wiki/RunningRails и http://gist.github.com/268192

В настоящее время я просто пытаюсь попасть в мир приветствия. Я получаю эти ошибки, когда я просто запускаю 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/ 

Я в растерянности, на каком шаге я мог пропустить. Я проверил свою версию ruby ​​(1.8.7) и версию rails (2.3.5), версию gem (1.3.6) и google-appengine-0.0.10.1

RAN:

sudo gem install google-appengine

завиток -O http://appengine -jruby.googlecode.com / HG / демки / rails2 / rails2_appengine.rb

ruby ​​rails2_appengine.rb

sudo gem install rails_dm_datastore

sudo gem install activerecord-nulldb-адаптер

поместите это в мой файл config.ru:

run lambda {| env | Rack :: Response.new ( 'Hello Мир! '). Конец}

и наконец побежал $ dev_appserver.rb.

1 Ответ

1 голос
/ 09 апреля 2010

Хорошо. Я получил некоторую помощь в группе Google от Джона Вуделла.

Для Rails, вы должны следовать инструкциям на Gist Привет приложение мира делает это ...

$ appcfg.rb generate_app hello-world  
$dev_appserver.rb hello-world

Я в растерянности, на каком шаге я мог пропустить. Я проверил свою версию ruby ​​(1.8.7) и версия рельсов (2.3.5), версия гемов (1.3.6) и google-appengine-0.0.10.1 побежал

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 

поместите это в мой файл config.ru:

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

и наконец побежал
$ dev_appserver.rb.

Ok. Я следил за всем и все еще столкнулся с проблемой. Разобрался в чем дело. Я начал создавать папки проекта и столкнулся с Unix Забавно-странно, не нравятся каталоги с пробелами в имена. как только я избавился от мест, все стало хорошо. Мальчик, я чувствую настоящий тупой прямо сейчас.

...