Error running .class generated by jrubyc

Hello guys,

I have just subscribed to this list, but I do not know if this is the
correct one.

I have a ruby script that runs perfect from the command line using
jruby.
I compiled 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 A.

Guillermo,

I’m pretty new to JRuby myself, but I suspect that you need to pass a
system property to java to tell JRuby and Gems what it’s loadpath is.
Sorry that I don’t have complete information for you, but I hope that
points you in the right direction for your google searches.

-Joel

----- Original Message -----
From: “Guillermo A.” [email protected]
To: [email protected]
Sent: Friday, July 25, 2008 9:01:05 AM GMT -06:00 US/Canada Central
Subject: [jruby-user] error running .class generated by jrubyc

Hello guys,

I have just subscribed to this list, but I do not know if this is the
correct one.

I have a ruby script that runs perfect from the command line using
jruby. I compiled 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 A.

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