No such file to load -- rubygems

I am trying to call ruby (User.rb)[Which uses ActiveRecord and will
return List of Table Rows]
My Environment is java(using spring framework - Tomcat) running In
Windows.
[Basically trying to run BSF part of
http://www.ociweb.com/mark/programming/ActiveRecord.html]

I am loading the Path as mentioned below,

private void addLoadPath(String path) {
String expr = “$: << '” + path + “'”;
ruby.evalScript(expr);
}

/**
$: << ‘C:/jruby-bin-1.1.3/jruby-1.1.3/lib’
$: << ‘C:/jruby-bin-1.1.3/jruby-1.1.3/lib/ruby/site_ruby/1.8’
$: << ‘C:/jruby-bin-1.1.3/jruby-1.1.3/lib/ruby/site_ruby/1.8/java’
$: << ‘C:/jruby-bin-1.1.3/jruby-1.1.3/lib/ruby/site_ruby’
$: << ‘C:/jruby-bin-1.1.3/jruby-1.1.3/lib/ruby/1.8’
$: << ‘C:/jruby-bin-1.1.3/jruby-1.1.3/lib/ruby/1.8/java’
***/

When i try to call
bsf.evalFile(“C://User.rb”); ==> is giving the following error
Exception: org.jruby.exceptions.RaiseException: No such file to load –
rubygems

Please help to resolve this issue.

Padmapriya Mahalingam wrote:

I am trying to call ruby (User.rb)[Which uses ActiveRecord and will
return List of Table Rows]
My Environment is java(using spring framework - Tomcat) running In
Windows.
[Basically trying to run BSF part of
R. Mark Volkmann | Object Computing, Inc.]

I am loading the Path as mentioned below,

private void addLoadPath(String path) {
String expr = “$: << '” + path + “'”;
ruby.evalScript(expr);
}

/**
$: << ‘C:/jruby-bin-1.1.3/jruby-1.1.3/lib’
$: << ‘C:/jruby-bin-1.1.3/jruby-1.1.3/lib/ruby/site_ruby/1.8’
$: << ‘C:/jruby-bin-1.1.3/jruby-1.1.3/lib/ruby/site_ruby/1.8/java’
$: << ‘C:/jruby-bin-1.1.3/jruby-1.1.3/lib/ruby/site_ruby’
$: << ‘C:/jruby-bin-1.1.3/jruby-1.1.3/lib/ruby/1.8’
$: << ‘C:/jruby-bin-1.1.3/jruby-1.1.3/lib/ruby/1.8/java’
***/

When i try to call
bsf.evalFile(“C://User.rb”); ==> is giving the following error
Exception: org.jruby.exceptions.RaiseException: No such file to load –
rubygems

Please help to resolve this issue.

I resolved the above issue by adding ‘ruby.getLoadService().init(list);’

But now i am getting another error ‘unable to load language: ruby:
org.jruby.exceptions.RaiseException: cannot load Java class JavaLang’ .

I have no clue where/why it is calling ‘JavaLang’. Please help to
resolve this issue.