我有一个加载 jruby 的可执行 jar。安装程序将 jar 和一些预打包的 jar 库(包括完整的 jruby 和一些 gem)放入安装位置。
一切正常,除了在 Windows 中,当 jar 安装到名称中带有空格的文件夹中时。当 Jruby 遇到来自 jar 打包的 gem 之一的简单“require”(如果重要的话,状态机 gem 中的“require singleton”)时,它会失败。
这不是什么大问题,但我需要 jar 从程序文件下运行。希望有人在那里解决了这个问题:)
堆栈跟踪:
> Java::OrgJrubyExceptions::RaiseException - no such file to load --
> singleton file:/C:/<install
> location>/lib/java/state_machine-0.9.4.jar!/state_machine/matcher.rb:1:
> in `require': no such file to load -- singleton (LoadError)
> from file:/C:/<install location>/lib/java/state_machine-0.9.4.jar!/state_machine/
> matcher.rb:1
> from file:/C:/<install location>/lib/java/state_machine-0.9.4.jar!/state_machine/
> matcher.rb:1:in `require'
> from file:/C:/<install location>/lib/java/state_machine-0.9.4.jar!/state_machine/ guard.rb:1
> from file:/C:/<install location>/lib/java/state_machine-0.9.4.jar!/state_machine/
> guard.rb:2:in `require'
> from file:/C:/<install location>/lib/java/state_machine-0.9.4.jar!/state_machine/ event.rb:2
> from file:/C:/<install location>/lib/java/state_machine-0.9.4.jar!/state_machine/
> event.rb:6:in `require'
> from file:/C:/<install location>/lib/java/state_machine-0.9.4.jar!/state_machine/
> machine.rb:6
> from file:/C:/<install location>/lib/java/state_machine-0.9.4.jar!/state_machine/
> machine.rb:1:in `require'
> from file:/C:/<install location>/lib/java/state_machine-0.9.4.jar!/state_machine. rb:1
> from file:/C:/<install location>/lib/java/state_machine-0.9.4.jar!/state_machine. rb:1:in
> `require'
> from src/application.rb:1:in `require'
> from src/main.rb:54:in `require'
> from <script>:1
> ...internal jruby stack elided...
> from Kernel.require(file:/C:/<install location>/lib/java/state_machine-0.9.4.jar!
> /state_machine/matcher.rb:1)
> from (unknown).(unknown)(file:/C:/<install location>/lib/java/state_machine-0.9.4
> .jar!/state_machine/matcher.rb:1)
> from Kernel.require(file:/C:/<install location>/lib/java/state_machine-0.9.4.jar! /state_machine/guard.rb:1)
> from (unknown).(unknown)(file:/C:/<install location>/lib/java/state_machine-0.9.4 .jar!/state_machine/guard.rb:2)
> from Kernel.require(file:/C:/<install location>/lib/java/state_machine-0.9.4.jar! /state_machine/event.rb:2)
> from (unknown).(unknown)(file:/C:/<install location>/lib/java/state_machine-0.9.4 .jar!/state_machine/event.rb:6)
> from Kernel.require(file:/C:/<install location>/lib/java/state_machine-0.9.4.jar!
> /state_machine/machine.rb:6)
> from (unknown).(unknown)(file:/C:/<install location>/lib/java/state_machine-0.9.4
> .jar!/state_machine/machine.rb:1)
> from Kernel.require(file:/C:/<install location>/lib/java/state_machine-0.9.4.jar! /state_machine.rb:1)
> from (unknown).(unknown)(file:/C:/<install location>/lib/java/state_machine-0.9.4 .jar!/state_machine.rb:1)
> from Kernel.require(src/application.rb:1)
> from Kernel.require(src/main.rb:54)
> from Kernel.require(<script>:1)
> from (unknown).(unknown)(:1)