[Rails] Re: executing an external application within rails

Jonathan Conway jonathan at agileevolved.com
Wed Dec 14 11:50:51 GMT 2005


Thank I've got a little bit further. It now works for date using the 
full path /bin/date but if say do something like %x{/usr/local/bin/svn} 
(this is just a test example), I thought I should at least get the svn 
message asking me for the parameters, but instead I get nothing back. 
Very strange.

It works without problem from /script/console and irb.. just not withing 
a rails app.

Any help greatly appreciated

Jon

Tom Mornini wrote:
> Your PATH environment variable or a fully qualified path to date?
> 
> -- -- Tom Mornini
> 
> On Dec 13, 2005, at 8:42 PM, Jonathan Conway wrote:
> 
>> Hi,
>> I seem to have come across a strange problem. I need to execute an  
>> external application, grab its return value and do something with it.
>> Sounds fine doesn't it? Unfortunetely I'm running into some problems.
>>
>> Just for example sake, lets say I want to execute the date command  on 
>> unix I'd do something like test = %x{date} or test IO.popen 
>> ('date').read and I should get a value back assigned to test right?  
>> Well it seems it only works from inside IRB and using the rails  console.
>>
>> When I execute this code from within a method in a Rails  application 
>> I get nothing back. Writing the output to the log show  nothing either.
>>
>> Is there something I'm missing?
>>
>> Cheers
>>
>> Jon
>>
>> _______________________________________________
>> Rails mailing list
>> Rails at lists.rubyonrails.org
>> http://lists.rubyonrails.org/mailman/listinfo/rails



More information about the Rails mailing list