尝试使用 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:in
const_ get' from C:/Ruby/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:467:inblock (3 levels) in attempt_load_autoload' from C:/Ruby/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:464:in
each' from C :/Ruby/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:464:inblock (2 levels) in attempt_load_autoload' from C:/Ruby/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:462:in
each' 来自 C:/Ruby/lib/ruby/gems/1.9.1/gems/ocra -1.3.0/bin/ocra:462:inblock in attempt_load_autoload' from C:/Ruby/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:456:in
loop' 来自 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:in
build_exe' 来自 C:/Ruby/lib/ruby/gems/1.9.1/gems/ocra-1.3.0/bin/ocra:1138:in `block in'C:\Ruby>