From: John Smith Date: 2009-12-31T02:24:11+09:00 Subject: Re: How to run one script from another, and capture the output Gary Wright wrote: > On Dec 30, 2009, at 8:06 AM, John Smith wrote: >> One more quick question. If distance_traveled.rb sits in a different >> directory than the current script that's calling it, how would I specify >> it? For example, say it is in ~project/lib/distance_traveled.rb > > The command is parsed by the shell so ~project/lib/distance_traveled.rb > should work or a relative or absolute path of course. > > Gary Wright Thanks for the help! However, I should also add that in the above example, distance_traveled.rb requires other .rb files sitting in the same lib directory. I have no problem running distance_traveled.rb from inside lib. However, from another directory, when I try to run the program using relative path (ie. 'ruby ../../lib/distance_traveled.rb'), I get "distance_traveled.rb:1:in `require': no such file to load -- ", in reference to the other .rb file(s) in the lib directory. Any suggestions for this issue? Thanks again! -- Posted via http://www.ruby-forum.com/.