launchctl - use rvm instead of system Ruby in executed scripts?
- by Stefan Kendall
I have a launchctl job I define as such:
<key>ProgramArguments</key>
<array>
<string>/bin/sh</string>
<string>-c</string>
<string>~/projects/script.sh</string>
</array>
When I run script.sh manually, the script works fine, as it uses the currently configured rvm version of ruby. When I run this through launchctl, the system version of Ruby is used, which breaks the script. How can I get this script to run with the right version of ruby available?