我使用Sinatra(JRuby 1.7.13,Ruby-1.9)创建了一个应用程序。该应用程序是基于机架的,并在后端使用MySQL。
我使用warbler制作war文件并在我的本地tomcat上成功部署。 Everyhting工作正常!
但是当我将war文件推送到openshift时(跟随所有procedure told in openshift知识库)。但是tomcat显示404错误。我查看了日志文件。我在这里附上一个巨大文件的陀螺 -
--- Backtrace
LoadError: no such file to load -- sinatra
require at org/jruby/RubyKernel.java:1065
require at file:/var/lib/openshift/53a807dfe0b8cd33450000c4/jbossews/work/Catalina
/localhost/_/WEB-INF/lib/jruby-stdlib-complete-1.7.13.jar!/META-INF/jruby.home/lib/ruby
/shared/rubygems/core_ext/kernel_require.rb:55
(root) at /localhost/WEB-INF/config.ru:2
instance_eval at org/jruby/RubyBasicObject.java:1533
initialize at file:/var/lib/openshift/53a807dfe0b8cd33450000c4/jbossews/work/Catalina/localhost/_/WEB-INF/lib/jruby-rack-1.1.14.jar!/vendor/rack-1.4.5/rack/builder.rb:51
(root) at /localhost/WEB-INF/config.ru:1
...
SEVERE: ERROR: initialization failed
org.jruby.rack.RackInitializationException: no such file to load -- sinatra
from org/jruby/RubyKernel.java:1065:in `require'
from file:/var/lib/openshift/53a807dfe0b8cd33450000c4/jbossews/work/Catalina/localhost/_/WEB-INF/lib/jruby-stdlib-complete-1.7.13.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:55:in `require'
from /localhost/WEB-INF/config.ru:2:in `(root)'
from org/jruby/RubyBasicObject.java:1533:in `instance_eval'
from file:/var/lib/openshift/53a807dfe0b8cd33450000c4/jbossews/work/Catalina/localhost/_/WEB-INF/lib/jruby-rack-1.1.14.jar!/vendor/rack-1.4.5/rack/builder.rb:51:in `initialize'
from /localhost/WEB-INF/config.ru:1:in `(root)'
at org.jruby.rack.RackInitializationException.wrap(RackInitializationException.java:29)
at org.jruby.rack.RackApplicationFactoryDecorator.init(RackApplicationFactoryDecorator.java:104)
at org.jruby.rack.RackServletContextListener.contextInitialized(RackServletContextListener.java:50)
....和....
Caused by: org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- sinatra
at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1065)
at RUBY.require(file:/var/lib/openshift/53a807dfe0b8cd33450000c4/jbossews /work/Catalina/localhost/_/WEB-INF/lib/jruby-stdlib-complete-1.7.13.jar!/META-INF/jruby.home /lib/ruby/shared/rubygems/core_ext/kernel_require.rb:55)
at RUBY.(root)(/localhost/WEB-INF/config.ru:2)
at org.jruby.RubyBasicObject.instance_eval(org/jruby/RubyBasicObject.java:1533)
at RUBY.initialize(file:/var/lib/openshift/53a807dfe0b8cd33450000c4/jbossews/work/Catalina/localhost/_/WEB-INF/lib/jruby-rack-1.1.14.jar!/vendor/rack-1.4.5/rack/builder.rb:51)
问题是 - 我应该怎么做才能部署一个warber生成的war文件,以便在openhift服务器中的tomcat中部署?那些东西在本地tomcat中工作得很好。
非常感谢!