error running .class generated by jrubyc

G

Guillermo.Acilu

[Note: parts of this message were removed to make it a legal post.]

Hello guys,

I have a ruby script that runs perfect from the command line using jruby.
So I tried to compile it with jrubyc and the .class is now generated.

Then I proceed to run it with java -cp .:/pathto/jruby.jar classname and I
receive the following error:

Exception in thread "main" search.rb:2:in `require': no such file to load
-- rubygems (LoadError)
from search.rb:2
...internal jruby stack elided...

What am I missing?

Thanks,

Guillermo Acilu
 
C

Charles Oliver Nutter

Hello guys,

I have a ruby script that runs perfect from the command line using jruby.
So I tried to compile it with jrubyc and the .class is now generated.

Then I proceed to run it with java -cp .:/pathto/jruby.jar classname and I
receive the following error:

Exception in thread "main" search.rb:2:in `require': no such file to load
-- rubygems (LoadError)
from search.rb:2
...internal jruby stack elided...

Basically you just need to specify where JRuby is located with the
jruby.home property. Othewise it can't find things like rubygems or Ruby
stdlib.

java -Djruby.home=/path/to/jruby -cp .:/pathto/jruby.jar classname

- Charlie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,142
Messages
2,570,819
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top