Ruby on Rails. Returning output of exe file to browser

165 Views Asked by At

First time using Ruby or Rails, so bear with me :) I am trying to output the results of an exe file to my browser, possibly with some processing before hand. I am using Open3

@stdout,@stderr,@status = Open3.capture3('c:\server.exe','')

This works, but the output only seems to return anything when the exe file has finished, eg if its closed manually, or if it returns an error.

What actually happens when I execute the file is a server runs and returns info to the console. I need this data in the console while its running, not after.

My question: How do I return, process, and display each line from the console in real time? Is that even possible?

0

There are 0 best solutions below