Execute external program in ruby and wait for its execution

前端 未结 3 1544
我在风中等你
我在风中等你 2021-02-20 11:15

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:41

    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"')
    

提交回复
热议问题