I have a MacRuby app, and after the app launches, I would like to launch a second process using an NSTask. The second process is a Ruby script bundled with the app. I would like to launch it using the MacRuby macruby interpreter that gets compiled into the app bundle. How can I do that?
Share
First, remove the .rb extension from the ruby script, otherwise if you compile the macruby project using macruby_deploy, it will be compiled to rbo file. The script file should have this as its first line:
Make sure the script will be copied to Resources folder.
Then create and call a NSTask: