I did completed a small desktop application in Jruby+swing. Now i want to deploy it. I found rawr is the best to build jar from non-web application. But
i got “rake aborted! private method `move’ called for File:Class” error when i try to build jar from Jruby project.
Here is the full trace from 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
I am using “rake rawr:jar” for building and my jruby version is 1.7.0.
Could any one tell me what’s going wrong…
Thank in advance.
File.moveseems to have been removed in Ruby 1.9.x. This could be a bug in rawr.File.renameshould be a good alternative.I believe the
movefunction was eliminated because it was not able to move things across filesystems and would cause numerous errors when that sort of thing was attempted. Most people do not test for this sort of thing, so it would often create problems when it affected someone trying to use it on a system with different partitions.The
renamemethod employs a different, more reliable approach and will copy as necessary.