I've seen this question asked a few times but no repsonses have worked for me. I've tried several versions of rjb, several jre versions..No matter what I try, when trying to use the rjb gem i get the following error:
DL is deprecated, please use Fiddle
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/bind-it-0.2.7/lib/bind-it/jar_loader.rb:45:in `load': can't create Java VM (RuntimeError)
I have JAVA_Home in my path. I am just using simple code to test rjb as I really just need this to work so the stanford open nlp gem will work for me.
Any explanations? Might help some other poor souls out there...I am running on windows if that helps
UPDATE: tried the following in the command line to troubleshoot
ruby -d -rubygems -rrjb -e 'Rjb::load'
Exception `LoadError' at c:/RailsInstaller/Ruby2.1.0/lib/ruby/site_ruby/2.1.0/rubygems.rb:1203 - cannot load such file -- rubygems/defaults/ruby
Exception `LoadError' at c:/RailsInstaller/Ruby2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55 - cannot load such file -- rjb
Exception `Fiddle::DLError' at c:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/fiddle.rb:46 - No such file or directory
DL is deprecated, please use Fiddle
Exception `DL::DLError' at -e:1 - No such file or directory
Exception `Fiddle::DLError' at c:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/fiddle.rb:46 - No such file or directory
Exception `DL::DLError' at -e:1 - No such file or directory
Exception `RuntimeError' at -e:1 - can't create Java VM
-e:1:in `load': can't create Java VM (RuntimeError)
from -e:1:in `<main>'
Does this mean there is an error with path or JAVA_HOME ? If so, how would I go about setting that correctly?
So after I finally came across a solution. rjb will only work if java and ruby are BOTH 32 bit or BOTH 64 bit. Different versions will cause the VM error.
To solve:
ruby -v
in terminaljavac
or java -v
in terminalBoom- Hope this works for everyone else as well!