org.jruby.exceptions.RaiseException: No such file to load -- thread.so

Hi

I am trying to call my ruby active record from java using JSR223. I am
running this in Windows Environment.

Here is my code:

public static void main(String[] args) throws Exception {

try{

             ScriptEngineManager mgr = new ScriptEngineManager();

             ScriptEngine engine = mgr.getEngineByName("jruby");

             engine.eval(new BufferedReader(new

FileReader(“User.rb”)));

} catch (ScriptException exception) {

    exception.printStackTrace();

}

}

When I try to run this , I am getting the following error

org.jruby.exceptions.RaiseException: No such file to load – thread.so

javax.script.ScriptException: org.jruby.exceptions.RaiseException: No
such file to load – thread.so

    at

com.sun.script.jruby.JRubyScriptEngine.evalNode(JRubyScriptEngine.java:3
86)

    at

com.sun.script.jruby.JRubyScriptEngine.eval(JRubyScriptEngine.java:144)

    at javax.script.AbstractScriptEngine.eval(Unknown Source)

    at EvalScript.main(EvalScript.java:36)

Caused by: org.jruby.exceptions.RaiseException: No such file to load –
thread.so

Please let me if any one has sample package of how call ruby
activerecord from java.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs