为什么 IronRuby 上的 Albacore zip 任务失败?

发布于 2024-11-05 21:12:01 字数 4332 浏览 0 评论 0原文

我尝试使用 Albacore 中的 zip 任务进行压缩,但出现错误。是 IronRuby 的问题吗?

task :publish => :build do
  Rake::Task[:service].invoke
  Rake::Task[:site].invoke
  Rake::Task[:zip_svc].invoke
end

zip :zip_svc do |zip|
  zip.directories_to_zip 'publish'
  zip.output_file = 'Svc.zip'
  zip.output_path = File.dirname(__FILE__)
end

错误>

** Invoke zip_svc (first_time)
** Execute zip_svc
rake aborted!
wrong number of arguments (1 for 2)
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:1113:in `<<'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:1062:in `<<'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/ioextras.rb:125:in `write'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/ioextras.rb:9:in `copy_stream'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:832:in `write_to_zip_output_stream'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:772:in `get_input_stream'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:832:in `write_to_zip_output_stream'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:1515:in `commit'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:1153:in `each'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:1153:in `each'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:1515:in `commit'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:963:in `open'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:1512:in `commit'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:1601:in `on_success_replace'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:1510:in `commit'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:1525:in `close'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:1415:in `open'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/albacore-0.2.5/lib/albacore/zipdirectory.rb:28:in `execute'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/albacore-0.2.5/lib/albacore/support/createtask.rb:24:in `zip'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `call'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in `each'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
c:/IronRuby/Lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
C:/Users/Thiago/projetos/Cosan/mapaestrutura/rakefile.rb:8
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `call'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in `each'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
c:/IronRuby/Lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/bin/rake:31
C:/IronRuby/bin/rake:19:in `load'
C:/IronRuby/bin/rake:19

I am trying to zip with the zip task in Albacore, but I get an error. Is it a problem with IronRuby?

task :publish => :build do
  Rake::Task[:service].invoke
  Rake::Task[:site].invoke
  Rake::Task[:zip_svc].invoke
end

zip :zip_svc do |zip|
  zip.directories_to_zip 'publish'
  zip.output_file = 'Svc.zip'
  zip.output_path = File.dirname(__FILE__)
end

Error>

** Invoke zip_svc (first_time)
** Execute zip_svc
rake aborted!
wrong number of arguments (1 for 2)
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:1113:in `<<'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:1062:in `<<'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/ioextras.rb:125:in `write'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/ioextras.rb:9:in `copy_stream'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:832:in `write_to_zip_output_stream'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:772:in `get_input_stream'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:832:in `write_to_zip_output_stream'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:1515:in `commit'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:1153:in `each'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:1153:in `each'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:1515:in `commit'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:963:in `open'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:1512:in `commit'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:1601:in `on_success_replace'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:1510:in `commit'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:1525:in `close'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rubyzip-0.9.4/lib/zip/zip.rb:1415:in `open'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/albacore-0.2.5/lib/albacore/zipdirectory.rb:28:in `execute'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/albacore-0.2.5/lib/albacore/support/createtask.rb:24:in `zip'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `call'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in `each'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
c:/IronRuby/Lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
C:/Users/Thiago/projetos/Cosan/mapaestrutura/rakefile.rb:8
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `call'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in `each'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
c:/IronRuby/Lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
c:/IronRuby/Lib/ruby/gems/1.9.1/gems/rake-0.8.7/bin/rake:31
C:/IronRuby/bin/rake:19:in `load'
C:/IronRuby/bin/rake:19

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

北城孤痞 2024-11-12 21:12:01

不幸的是,zip 任务是 IronRuby 中少数无法正常工作的项目之一。我已经看过好几次了,但也没有找到 ruby​​zip 库的合适替代品。我建议使用 7-zip(免费/非常好的工具)等外部工具,并从 exec 任务中调用它。

Unfortunately, the zip task is one of the few items that does not work correctly in IronRuby. I've looked several times, but have not found a suitable replacement for the rubyzip lib, either. I recommend using an external tool like 7-zip (free/very good tool) and call it from the exec task.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文