Re: New Problem With IO.popen?

Ben Schumacher
Fri, 15 Apr 2005 05:44:36 -0000

John-

This looks to be like a pathing problem and not a Rails problem. You
might want to go ahead and try on this machine doing something like
''which java'' and then explicitly specifying the path in the
IO.popen.

$ which java
/usr/local/bin/java

In code:

IO.popen("/usr/local/bin/java -version", "w+")

Just a thought.

Cheers,

bs.

On 4/14/05, John Marsan <jmarsan-JxUet7QE5mQXhy9q4Lf3Ug@public.gmane.org>
wrote:
>
> I have a small rails app that was working fine on one system and have moved
> it to a new system with all the latest code.  In my controller I''m
calling
> IO.popen to call some java code but this isn''t working anymore.
>
> For example here I''m doing in the controller:
>
>                 displayXml = IO.popen("java -version",
"w+")
>
> And then I get an error in appache that has me stumped at this point:
>
> [Thu Apr 14 23:03:30 2005] [error] [client 10.10.1.48]
> /usr/local/lib/ruby/site_ruby/1.8/rubyge
> ms/custom_require.rb:18: command not found: java -version, referer:
> http://10.10.99.101/filing/
> search.
>
> Code like this was working with (I think) gem version 0.8.3.  New system ha
> 0.8.8.
>
> Thanks for any help you can provide!