[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

error running .class generated by jrubyc

Guillermo.Acilu

7/24/2008 4:08:00 PM

[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

2 Answers

Robert Dober

7/24/2008 6:51:00 PM

0

Maybe you should post this to the JRuby ML rather than ruby-talk.

Robert

--
http://ruby-smalltalk.blo...

There's no one thing that's true. It's all true.
--
Ernest Hemingway

Charles Oliver Nutter

7/28/2008 7:34:00 PM

0

Guillermo.Acilu@koiaka.com wrote:
> 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