I recently encountered a strange problem when trying to redirect the
ScriptEngine output for my ruby session. It seems that no matter what I
pass in to my ScriptEngine, it always prints to stdout and stderr. I
found this post, but it says it’s fixed.
Yet it still goes to stdout every time. Has this issue truly been
resolved?
What version of JRuby are you using? JSR223 implementation was
rewritten and has been included in JRuby since 1.4.0. If you are using
JRuby 1.4.x or 1.5.x, remove jruby-engine.jar from your classpath.
Then, above code should work.
Yet it still goes to stdout every time. Has this issue truly been
resolved?
What version of JRuby are you using? JSR223 implementation was
rewritten and has been included in JRuby since 1.4.0. If you are using
JRuby 1.4.x or 1.5.x, remove jruby-engine.jar from your classpath.
Then, above code should work.
I just added the jruby-complete-1.5.6.jar to my classpath. Is there a
link to a smaller distribution I could add there? I just downloaded the
complete jar recently from the jruby website.
I’m not sure you actually need jruby-complete.jar since it depends on
how you use it. But, usually people download JRuby from jruby.org. The
archive downloaded from jruby.org has jruby.jar, which is smaller than
jruby-complete.jar.
The complete jar is “complete” because it contains the Ruby standard
library + Rubygems.
This one is the core JRuby classes and is a few megs lighter, if that
helps.
What version of JRuby are you using? JSR223 implementation was
rewritten and has been included in JRuby since 1.4.0. If you are using
JRuby 1.4.x or 1.5.x, remove jruby-engine.jar from your classpath.
Then, above code should work.
I just added the jruby-complete-1.5.6.jar to my classpath. Is there a
link to a smaller distribution I could add there? I just downloaded the
complete jar recently from the jruby website.
I’m not sure you actually need jruby-complete.jar since it depends on
how you use it. But, usually people download JRuby from jruby.org. The
archive downloaded from jruby.org has jruby.jar, which is smaller than
jruby-complete.jar.
I’ve tried this one as well. I need some of those gems like ‘set’ and
‘singleton’. Are you guys saying I can’t use these libraries because
the ruby version doesn’t handle redirection correctly?
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.