耙子流产了!私有方法`move'调用File:Class

时间:2012-11-14 06:09:19

标签: ruby rake jruby

我在Jruby + swing中完成了一个小型桌面应用程序。现在我想部署它。我发现rawr是从非Web应用程序构建jar的最佳选择。但 当我尝试从Jruby项目构建jar时,我得到了“ rake aborted!private method'movement'for File:Class ”错误。

以下是cmd promet的完整描述:

E:\NETBEANS\KeyingClient_jruby\lib>rake rawr:jar --trace
c:/jruby-1.7.0/lib/ruby/gems/shared/gems/rawr-1.2/lib/zip/zip.rb:28: Use RbConfi
g instead of obsolete and deprecated Config.
** Invoke rawr:jar (first_time)
** Invoke rawr:compile (first_time)
** Invoke rawr:compile_java_classes (first_time)
** Invoke rawr:prepare (first_time)
** Invoke rawr:load_configuration (first_time)
** Execute rawr:load_configuration
** Execute rawr:prepare
** Execute rawr:compile_java_classes
** Invoke rawr:compile_ruby_classes (first_time)
** Invoke rawr:prepare
** Execute rawr:compile_ruby_classes
** Invoke rawr:copy_other_file_in_source_dirs (first_time)
** Invoke rawr:prepare
** Execute rawr:copy_other_file_in_source_dirs
** Execute rawr:compile
** Invoke rawr:build_data_jars (first_time)
** Invoke rawr:prepare
** Execute rawr:build_data_jars
** Execute rawr:jar
=== Creating jar file: E:/NETBEANS/KeyingClient_jruby/lib/package/jar/KeyingClie
nt.jar
rake aborted!
private method `move' called for File:Class
c:/jruby-1.7.0/lib/ruby/gems/shared/gems/rawr-1.2/lib/zip/zip.rb:1570:in `on_suc
cess_replace'
c:/jruby-1.7.0/lib/ruby/gems/shared/gems/rawr-1.2/lib/zip/zip.rb:1478:in `commit
'
c:/jruby-1.7.0/lib/ruby/gems/shared/gems/rawr-1.2/lib/zip/zip.rb:1493:in `close'

c:/jruby-1.7.0/lib/ruby/gems/shared/gems/rawr-1.2/lib/zip/zip.rb:1385:in `open'
c:/jruby-1.7.0/lib/ruby/gems/shared/gems/rawr-1.2/lib/jar_builder.rb:40:in `buil
d'
c:/jruby-1.7.0/lib/ruby/gems/shared/gems/rawr-1.2/lib/rawr.rb:171:in `(root)'
org/jruby/RubyProc.java:249:in `call'
c:/jruby-1.7.0/lib/ruby/gems/shared/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `e
xecute'
org/jruby/RubyArray.java:1612:in `each'
c:/jruby-1.7.0/lib/ruby/gems/shared/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `e
xecute'
c:/jruby-1.7.0/lib/ruby/gems/shared/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `i
nvoke_with_call_chain'
c:/jruby-1.7.0/lib/ruby/1.9/monitor.rb:211:in `mon_synchronize'
c:/jruby-1.7.0/lib/ruby/gems/shared/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `i
nvoke_with_call_chain'
c:/jruby-1.7.0/lib/ruby/gems/shared/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `i
nvoke'
c:/jruby-1.7.0/lib/ruby/gems/shared/gems/rake-0.9.2.2/lib/rake/application.rb:11
6:in `invoke_task'
c:/jruby-1.7.0/lib/ruby/gems/shared/gems/rake-0.9.2.2/lib/rake/application.rb:94
:in `top_level'
org/jruby/RubyArray.java:1612:in `each'
c:/jruby-1.7.0/lib/ruby/gems/shared/gems/rake-0.9.2.2/lib/rake/application.rb:94
:in `top_level'
c:/jruby-1.7.0/lib/ruby/gems/shared/gems/rake-0.9.2.2/lib/rake/application.rb:13
3:in `standard_exception_handling'
c:/jruby-1.7.0/lib/ruby/gems/shared/gems/rake-0.9.2.2/lib/rake/application.rb:88
:in `top_level'
c:/jruby-1.7.0/lib/ruby/gems/shared/gems/rake-0.9.2.2/lib/rake/application.rb:66
:in `run'
c:/jruby-1.7.0/lib/ruby/gems/shared/gems/rake-0.9.2.2/lib/rake/application.rb:13
3:in `standard_exception_handling'
c:/jruby-1.7.0/lib/ruby/gems/shared/gems/rake-0.9.2.2/lib/rake/application.rb:63
:in `run'
c:/jruby-1.7.0/lib/ruby/gems/shared/gems/rake-0.9.2.2/bin/rake:33:in `(root)'
org/jruby/RubyKernel.java:1045:in `load'
c:/jruby-1.7.0/bin/rake:23:in `(root)'
Tasks: TOP => rawr:jar

我正在使用“rake rawr:jar”进行构建,我的jruby版本是1.7.0。

任何人都可以告诉我出了什么问题......

提前感谢。

1 个答案:

答案 0 :(得分:2)

File.move似乎是removed in Ruby 1.9.x。这可能是rawr中的错误。 File.rename应该是一个不错的选择。

我认为move函数已被删除,因为它无法在文件系统之间移动,并且在尝试此类事件时会导致大量错误。大多数人都没有测试这种事情,因此当它影响某人试图在具有不同分区的系统上使用它时,它常常会产生问题。

rename方法采用了一种不同的,更可靠的方法,并会根据需要进行复制。