It's a little late, but I will leave it here for others looking for something like that.
In my opinion, the easiest way to execute a system command and get its results in Ruby is to encapsulate the system command, which will be executed in reverse ticks. For example,
result = 'ls -a' #This would run 'ls-a' and return its output, to our variable "result"
This article describes other ways to run system commands using Ruby.
Anuj khandelwal
source share