Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: Adam Davies
RE: Rjb and ocra [ reply ]  
2013-02-21 00:32
Hmmm. I had the wrong exe. Now i am back to the JVM can't load issue.

By: Adam Davies
RE: Rjb and ocra [ reply ]  
2013-02-21 00:29
Ok, so I looked through the code and found that your load.c uses ruby require 'dl'. That is a ruby core lib... which I discovered is used to load dll's.

So, not sure why that's failing. Must be an ocra thing.

I tried ocra with option to include full core ruby libs, but it made no difference....

Any ideas?

Myself, I'm surprised it works on the original machine if it fails on the second machine for this reason...

By: Adam Davies
RE: Rjb and ocra [ reply ]  
2013-02-20 23:43
My original WinXP program files path is same as the Win7 virtual box : "\Program Files". There is no "\Program Files (x86)" in the Win7 box. I checked and both are 32 bit windows.

Actually both have exact same full JAVA_HOME since I just installed latest Java JDK.

I was going to try your idea of setting JAVA_HOME in script, but tried same test as before one more time (now after a fresh reboot). This time I got a different error...

"LoadError at / cannot load such file -- dl"
at time of Rjb::import

Do you know what this one means?

By: arton Tajima
RE: Rjb and ocra [ reply ]  
2013-02-20 16:06
Hi

Thanks for the report, it's something surprising for me that Orca can handle Rjb.
BTW, the most common reason of "can't create java JVM" is Rjb can't find it. The environment variable JAVA_HOME correctly points JDK installed directory ? if JAVA_HOME points x64 version of JDK but Ruby is x86 version, it also fails.

I think that the easy way to deploying any PC is to give JAVA_HOME by the script itself.
for ex)
#--- start of script
Dir.foreach('/program files (x86)') do |x|
if x =~ /java/i
# search latest java directory
ENV['JAVA_HOME'] = # absolute path name for it
break
end
end

require 'rjb' # rjb looks up JVM correctly
...

Regards.

By: Adam Davies
Rjb and ocra [ reply ]  
2013-02-20 13:42
Hello,
Rjb is working really well for me.

However, I'm trying to package up an easy to use windows exe so I can deploy very easily.

I successfully used ocra (http://ocra.rubyforge.org/) to generate an exe on a win xp machine. It worked fine on that machine.

I copied the .exe to another machine (windows 7, same jvm) and although the ruby app ran, Rjb failed. It said "RuntimeError at /
can't create Java VM" at time of Rjb::import.

Can you give any help for this?

Alternatively, is there some way for easy deployment to different PC's where I can use RJB?