Dev,
I am trying to call ruby (User.rb)[Which uses ActiveRecord and will Print the first row of 'User' Table ] 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] When i try to call bsf.evalFile("C://User.rb"); ==> is giving the following error unable to load language: ruby: org.jruby.exceptions.RaiseException: cannot load Java class JavaLang Please help me to resolve this issue. My Jruby version : jruby-1.1.3 User.rb: require 'connector' class User def getUser u = User.find :first puts u.inspect end end h = User.new h.getUser() connector.rb: #!/usr/bin/ruby require 'rubygems' gem 'activerecord' require 'ActiveRecord' require 'YAML' ActiveRecord::Base.logger = Logger.new(STDOUT) dbconfig = YAML::load(File.open('../config/database.yml')) ActiveRecord::Base.establish_connection(dbconfig['connector']) require '../lib/polymorphic_model_methods' Dir.glob(File.join(File.dirname(__FILE__), '../app/models/*.rb')).each {|f| require f }
