문제

I have a java application, packaged into a .EAR file, that have code that runs in JRuby using script containers.
The ruby code runs normal, except when it need to require some other files that are packaged into the same .EAR file.

puts "x";
require 'my_other_ruby_file.rb';

Results in this error:

LoadError: no such file to load --my_other_ruby_file

Does anybody have some idea?

Thanks in advance.

도움이 되었습니까?

해결책

Loading files in that way requires they be visible in the application's classpath. So depending on your EAR layout, you'll need to make sure that the part your JRuby app is deployed in can see the part where the .rb file is located.

Other than that, it's just standard EAR classpath behavior.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top