From: Kirk Haines Date: 2004-09-01T10:55:06+09:00 Subject: Re: IOWA -- another newbie question On Wed, 1 Sep 2004 09:40:23 +0900, Mark Probert wrote > What is the best way of running an external script and returning the > results from within IOWA? > > I have been doing the > > @output = %x(ruby my_script) > > and getting nowhere (the "ruby my_script" works correctly from the > command line). > > I assume that I need to use a cgi-bin wrapper or similar? There should be no difference between running an external script from within an IOWA app and any other Ruby program. So, if %x(ruby my_script) is not working, my guess is that it is either because the PATH of the IOWA process doesn't have ruby in it, or my_script is not in the current working directory of the process. Your safest bet is to explicitly specify the path to your ruby executable and the path to your script. Something like this: ruby = File::join(::Config::CONFIG['bindir'], ::Config::CONFIG['ruby_install_name']) ruby << ::Config::CONFIG['EXEEXT'] @output = %x(#{ruby} /path/to/my_script)