wood burning stoves 2.0*
The moose likes Ruby and the fly likes Error while calling ruby code using JRuby in Eclipse Aptana Studio 3 Terminal View Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Ruby
Bookmark "Error while calling ruby code using JRuby in Eclipse Aptana Studio 3 Terminal View" Watch "Error while calling ruby code using JRuby in Eclipse Aptana Studio 3 Terminal View" New topic
Author

Error while calling ruby code using JRuby in Eclipse Aptana Studio 3 Terminal View

Mahesh Chandran
Greenhorn

Joined: Mar 23, 2011
Posts: 20
Hi all,

I have a set of ruby code (which is actually a gem that I extracted and the lib folder contains a bunch of .rb (ruby code). I have Eclipse Aptana Studio 3 plugin setup and have JRuby

$ jruby -v
jruby 1.7.4 (1.9.3p392) 2013-05-16 2390d3b on Java HotSpot(TM) 64-Bit Server VM 1.
6.0_45-b06 [Windows 7-amd64]


I need to execute a ruby file: /lib/my_rubycaller.rb, which is like the following:



Now at the Aptana Studio 3 Terminal View, I typed the following:

$ jruby -S lib/my_rubycaller.rb
LoadError: no such file to load -- somedependency
require at org/jruby/RubyKernel.java:1054
require at c:/Users/mkorapat/MyProjects/jruby-1.7.4/lib/ruby/shared/rubygems/cor
e_ext/kernel_require.rb:51
(root) at my_rubycaller.rb:11


Inside my_rubycaller @ line# 11, I have the require statement. I don't know what I am doing wrong. I am new to Ruby development, but since I am versatile with Eclipse, just stuck to Aptana and JRuby is just because I thought perhaps I could leverage some additional benefits that it has to offer. But it might still be a matter of time for me to go with Ruby as against JRuby, but still, I wonder how it will help me in this scenario.

Thanks in advance for the help.

Regards
Mahesh


Mahesh Chandran
Greenhorn

Joined: Mar 23, 2011
Posts: 20
just changed require to require_relative - since apparently my JRuby version seems to use ruby 1.9 and I see that require_relative is the way to go. Refer to http://stackoverflow.com/questions/9750610/ruby-require-error-cannot-load-such-file. So long so good. Thanks.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Error while calling ruby code using JRuby in Eclipse Aptana Studio 3 Terminal View