I have a Ruby script that I am triggering with an OS X launchagent. The script reads a bunch of files (21 total) from disk, does some processing, compiles them into an RSS feed, and uploads it to a remote machine using scp. The script works fine when I run it from the command line. However, when I run it with a launchagent I run into some very strange issues. I have isolated the problem to this line:
match = @content.match(/(?<=^ID: )\d+/)
@content
here refers to the contents of a file, read in earlier. This line is embedded in a class which serially processes each file. Something about this line is somehow causing execution to be dropped-- when I put a log statement after this line, it is triggered only for 16/21 of the files when running as launchagent. When running from the command line, there is no issue.
I also have noticed that these 5 files are almost, but not exactly, the five largest of the 21 files. What could possibly be going on? Any well-known typical issues when working with LaunchAgents?
UPDATE: this is one of the files that is breaking the code.