为什么 IronRuby 上的 Albacore zip 任务失败?
我尝试使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,
zip
任务是 IronRuby 中少数无法正常工作的项目之一。我已经看过好几次了,但也没有找到 rubyzip 库的合适替代品。我建议使用 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 therubyzip
lib, either. I recommend using an external tool like 7-zip (free/very good tool) and call it from theexec
task.