I have to run an executable file using ruby.How it is possible? Am using following code.also how can i check that file is executed or not
f = IO.popen("~/local/bin/test")
Use Ruby's Kernel#system method to run commands. This will return true if the command ran successfully and false otherwise:
system('~/local/bin/test')
Taken from here: http://mentalized.net/journal/2010/03/08/5_ways_to_run_commands_from_ruby/ There are other options, too. It depends whether you want to run it in the current process, create a sub-process, need to know the execution state etc.