Search code examples
rubywindowssystempopen3

Ruby run external program stops script


I have a ruby script that midway through I need it to run another program.

After running the program the rest of the script doesnt get run. For example:

# some ruby that gets run

exe = "Something.exe"
system(exe)

# some ruby that doesnt run

I have also tried using Open3.popen2e(cmd) and Open3.popen3(cmd) but its the same.

Can anyone help me understand what is happening here and how to fix it?

note: I'm using windows


Solution

  • Try to run Something.exe in a new Thread:

    Thread.new { system("Something.exe") }