Execute external program in ruby and wait for its execution

前端 未结 3 1050
没有蜡笔的小新
没有蜡笔的小新 2021-02-20 10:53

How do I start an external program (like an excel sheet) from ruby and wait for its execution resp. termination before continuing.

I know I can start the excel sheet wit

3条回答
  •  离开以前
    2021-02-20 11:49

    The problem you are having is not with Ruby but the start command, this launches another program and returns immediately. You need to make that command wait for excel to finish using the wait flag:

    system('start /wait excel "my/path/to/the/sheet"')
    

提交回复
热议问题