RoR 错误:无法将 Warbler::WebxmlOpenStruct 转换为数组
我安装了 Warbler gem 来创建 .war
文件。我尝试使用 warble 命令创建 .war 文件,但每次尝试时都会收到以下错误:
warble aborted!
can't convert Warbler::WebxmlOpenStruct to Array (Warbler::WebxmlOpenStruct#to_a
gives Warbler::WebxmlOpenStruct)
C:/Ruby192/lib/ruby/gems/1.9.1/gems/warbler-1.2.1/lib/warbler/config.rb:352:in `
block in context_params'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/warbler-1.2.1/lib/warbler/config.rb:352:in `
delete_if'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/warbler-1.2.1/lib/warbler/config.rb:352:in `
context_params'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/warbler-1.2.1/lib/warbler/config.rb:344:in `
block in context_params'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/warbler-1.2.1/lib/warbler/config.rb:341:in `
each'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/warbler-1.2.1/lib/warbler/config.rb:341:in `
context_params'
(erb):5:in `erb_binding'
C:/Ruby192/lib/ruby/1.9.1/erb.rb:753:in `eval'
C:/Ruby192/lib/ruby/1.9.1/erb.rb:753:in `result'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/warbler-1.2.1/lib/warbler/war.rb:200:in `exp
and_erb'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/warbler-1.2.1/lib/warbler/war.rb:77:in `bloc
k in add_webxml'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:1270:in `each'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:1270:in `block (2 levels) in <class:FileList>'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/warbler-1.2.1/lib/warbler/war.rb:75:in `add_
webxml'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/warbler-1.2.1/lib/warbler/war.rb:52:in `appl
y'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/warbler-1.2.1/lib/warbler/task.rb:111:in `bl
ock in define_files_task'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:634:in `call'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:634:in `block in execute'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:629:in `each'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:629:in `execute'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:595:in `block in invoke_with_call_chain'
C:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:581:in `invoke'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/warbler-1.2.1/lib/warbler/task.rb:90:in `blo
ck (2 levels) in define_main_task'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/warbler-1.2.1/lib/warbler/task.rb:89:in `eac
h'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/warbler-1.2.1/lib/warbler/task.rb:89:in `blo
ck in define_main_task'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:634:in `call'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:634:in `block in execute'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:629:in `each'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:629:in `execute'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:595:in `block in invoke_with_call_chain'
C:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:605:in `block in invoke_prerequisites'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:602:in `each'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:602:in `invoke_prerequisites'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:594:in `block in invoke_with_call_chain'
C:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:581:in `invoke'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2041:in `invoke_task'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in `block (2 levels) in top_level'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in `each'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in `block in top_level'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2013:in `top_level'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:1992:in `run'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/warbler-1.2.1/lib/warbler/application.rb:68:
in `run'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/warbler-1.2.1/bin/warble:11:in `<top (requir
ed)>'
C:/Ruby192/bin/warble:19:in `load'
C:/Ruby192/bin/warble:19:in `<main>'
如何解决它?
I installed the Warbler gem for creating .war
file. I have tried creating a .war file using the warble command but I get following error each time I try:
warble aborted!
can't convert Warbler::WebxmlOpenStruct to Array (Warbler::WebxmlOpenStruct#to_a
gives Warbler::WebxmlOpenStruct)
C:/Ruby192/lib/ruby/gems/1.9.1/gems/warbler-1.2.1/lib/warbler/config.rb:352:in `
block in context_params'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/warbler-1.2.1/lib/warbler/config.rb:352:in `
delete_if'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/warbler-1.2.1/lib/warbler/config.rb:352:in `
context_params'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/warbler-1.2.1/lib/warbler/config.rb:344:in `
block in context_params'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/warbler-1.2.1/lib/warbler/config.rb:341:in `
each'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/warbler-1.2.1/lib/warbler/config.rb:341:in `
context_params'
(erb):5:in `erb_binding'
C:/Ruby192/lib/ruby/1.9.1/erb.rb:753:in `eval'
C:/Ruby192/lib/ruby/1.9.1/erb.rb:753:in `result'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/warbler-1.2.1/lib/warbler/war.rb:200:in `exp
and_erb'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/warbler-1.2.1/lib/warbler/war.rb:77:in `bloc
k in add_webxml'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:1270:in `each'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:1270:in `block (2 levels) in <class:FileList>'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/warbler-1.2.1/lib/warbler/war.rb:75:in `add_
webxml'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/warbler-1.2.1/lib/warbler/war.rb:52:in `appl
y'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/warbler-1.2.1/lib/warbler/task.rb:111:in `bl
ock in define_files_task'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:634:in `call'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:634:in `block in execute'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:629:in `each'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:629:in `execute'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:595:in `block in invoke_with_call_chain'
C:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:581:in `invoke'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/warbler-1.2.1/lib/warbler/task.rb:90:in `blo
ck (2 levels) in define_main_task'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/warbler-1.2.1/lib/warbler/task.rb:89:in `eac
h'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/warbler-1.2.1/lib/warbler/task.rb:89:in `blo
ck in define_main_task'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:634:in `call'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:634:in `block in execute'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:629:in `each'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:629:in `execute'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:595:in `block in invoke_with_call_chain'
C:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:605:in `block in invoke_prerequisites'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:602:in `each'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:602:in `invoke_prerequisites'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:594:in `block in invoke_with_call_chain'
C:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:588:in `invoke_with_call_chain'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:581:in `invoke'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2041:in `invoke_task'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in `block (2 levels) in top_level'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in `each'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in `block in top_level'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2013:in `top_level'
C:/Ruby192/lib/ruby/1.9.1/rake.rb:1992:in `run'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/warbler-1.2.1/lib/warbler/application.rb:68:
in `run'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/warbler-1.2.1/bin/warble:11:in `<top (requir
ed)>'
C:/Ruby192/bin/warble:19:in `load'
C:/Ruby192/bin/warble:19:in `<main>'
How to resolve it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我还没有用 1.9.2 测试过 Warbler,我猜这是一个错误。我建议使用 JRuby 来运行它以获得最佳结果,直到问题得到解决。您介意将其提交到 https://github.com/nicksieger/warbler/issues 吗?包含 config/warble.rb 的内容(如果有)。谢谢!
I haven't tested Warbler with 1.9.2 yet, and I'm guessing this is a bug. I'd suggest using JRuby to run it for best results until the issue has been resolved. Would you mind filing this over at https://github.com/nicksieger/warbler/issues? Include contents of config/warble.rb, if any. Thanks!