2

尝试使用 ocra 将 ruby​​ 脚本编译为 Windows 可执行文件。由于某种原因,将 business_time 添加到脚本后,它拒绝编译。如果我删除 require 'business_time' 它将编译。所以我为 business_time 创建了一个脚本,它可以工作但不会编译。努力从错误消息中查看问题所在。

提前致谢。

require 'rubygems'
require 'business_time'

puts 1.business_day.ago.strftime("%Y%m%d") 
puts 1.business_day.ago.strftime("%m/%d/%Y")

C:/Ruby/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:467:使用 RbConfig 代替过时和弃用的 Config。C:/Ruby/lib/ruby/gems/1.9.1/gems/i18n-0.6.1/lib/i18n/tests/basics.rb:8:in test' : unknown command 'a' (ArgumentError) from C:/Ruby/lib/ruby/gems/1.9.1/gems/i18n-0.6.1/lib/i18n/tests/basics.r b:8:in'来自 C:/Ruby/lib/ruby/gems/1.9 .1/gems/i18n-0.6.1/lib/i18n/tests/basics.r b:3:in <module:Tests>' from C:/Ruby/lib/ruby/gems/1.9.1/gems/i18n-0.6.1/lib/i18n/tests/basics.r b:2:in'来自 C:/Ruby/lib/ruby/gems/1.9.1/gems/i18n-0.6.1/lib /i18n/tests/basics.r b:1:in <top (required)>' from C:/Ruby/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:467:inconst_ get' from C:/Ruby/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:467:in block (3 levels) in attempt_load_autoload' from C:/Ruby/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:464:ineach' from C :/Ruby/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:464:in block (2 levels) in attempt_load_autoload' from C:/Ruby/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:462:ineach' 来自 C:/Ruby/lib/ruby/gems/1.9.1/gems/ocra -1.3.0/bin/ocra:462:in block in attempt_load_autoload' from C:/Ruby/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:456:inloop' 来自 C:/Ruby/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:456:attemp t_load_autoload' from C:/Ruby/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:679:inbuild_exe' 来自 C:/Ruby/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:1138:in `block in'

C:\Ruby>
4

0 回答 0