Upgraded to Mavericks and now launchd / Lingon is unable to launch Ruby scripts. I have the files set to be executable (using chmod +x), and have the first lines set to
#!/usr/bin/ruby
However, I keep getting the following error in Console:
com.apple.launchd.peruser.501[169] (craig.logging[754]): Exited with code: 1
That is a permissions error, but I have no idea what permissions to fix or change. The script runs fine in terminal with ruby.
This is driving me nuts.
Update: the Ruby scripts that are causing the problem write their output to another file, for example, in my Dropbox. But I'm running the launchd files as myself who has admin privileges to write to those files. No idea what's going wrong...]
Update 2: Have started using Applescript to launch the Terminal and run my scripts, but this is pretty clumsy and inelegant. Anyone else have any insight to why launchd won't run scripts that write their output to files? Or is anyone having success with scripts that do?
Update 3: The failures were being triggered because of encoding issues. I had to specifically set file.open(path/to/file, encoding: 'UTF-8') for the scripts to work.
Thanks everyone.