This question fits somewhere between server fault, stackoverflow and askdifferent.
I am installing some web apps on my Lion server using webappctl, which hooks into apaches vhost configs to setup up a reverse proxy (simply mod_proxy). It uses launchd to start the server, in my case unicorn serving a Ruby on Rails app, listening on TCP port 5000. I use RVM (mixed-mode) to facilitate in separate ruby versions and gemsets for each webapp.
The problem lies with RVM and launchd, and the complete environment not being available for launchd.
I tried to start from launchd using /bin/bash -l -c 'unicorn_rails -l 5000'
but that gave me bash usage errors in the logs.
Any suggestions for making RVM play nice with launchd?
Best Answer
I found a way to make a
RVM
-basedrake
command work withlaunchd
:My script was calling
rake
. I wasn't calling it directly.Have you tried using an absolute path for your
unicorn_rails
?The
.plist
looks like: