使用 warbler 生成 war 文件

Generate war file using warbler

我正在尝试使用 warbler for jruby 生成 war 文件,但我卡住了,我收到了这个错误:

warble aborted!
NoMethodError: undefined method `booter=' for nil:NilClass
config/warble.rb:9:in `block in initialize' /Users/xxx/.rvm/gems/jruby-9.0.5.0/gems/warbler-2.0.4/lib/warbler/config.rb:216:in `initialize'
config/warble.rb:4:in `<eval>' 
/Users/xxx/.rvm/gems/jruby-9.0.5.0/gems/warbler-2.0.4/lib/warbler/task.rb:46:in `initialize'
/Users/xxx/.rvm/gems/jruby-9.0.5.0/gems/warbler-2.0.4/lib/warbler/application.rb:27:in `load_rakefile' 
/Users/xxx/.rvm/gems/jruby-9.0.5.0/gems/warbler-2.0.4/lib/warbler/application.rb:79:in `run'
/Users/xxx/.rvm/gems/jruby-9.0.5.0/gems/warbler-2.0.4/lib/warbler/application.rb:74:in `run' 
/Users/xxx/.rvm/gems/jruby-9.0.5.0/gems/warbler-2.0.4/bin/warble:11:in `<top>'
/Users/xxx/.rvm/gems/jruby-9.0.5.0/bin/warble:23:in `<top>'
(See full trace by running task with --trace)

我的配置文件在 config/warble.rb:

Warbler::Config.new do |config|
  config.dirs = %w(app config views)
  config.gems += ["sinatra"]
  config.gems -= ["rails"]
  config.jar_name = "jsinatra"
  config.webxml.booter = :rack
  config.webxml.jruby.compat.version = "1.9"
  config.webxml.rackup.path = '/WEB-INF/config.ru'
end

任何帮助,建议都适用。谢谢。

总的来说,我正在尝试创建 docker 容器,并且我正在使用 pdf 文件作为参考,但 pdf 的书写方式有些含糊。 http://www.ibm.com/developerworks/cloud/library/cl-sinatra-softlayer-app/cl-sinatra-softlayer-app-pdf.pdf

为我工作

在我发布的 pdf 文件中,有一个名为 rackup.ru 的文件,内容如下:

require "sinatra"
require File.dirname(__FILE__) + '/app/main'
run MyApp

经过几个小时的谷歌搜索,我决定创建相同的文件并将其命名为 config.ru。工作了。

不工作

我也试过改

config.webxml.rackup.path = '/WEB-INF/config.ru'

config.webxml.rackup.path = '/WEB-INF/rackup.ru'

没有成功。