puppetlabs-operations/puppet-unicorn — pull request #8 by geoffgarside (2014-03-18 15:44:23+00:00)
Title: Add rbenv support (FreeBSD)

Firstly allows an explicit path to a unicorn binary to be specified as the "source" parameter. This is the main part which is required to allow rbenv support as the binstub'd unicorn can be specified.

The second part adds `~/.rbenv` detection to the FreeBSD `rc.d-unicorn.erb` script so that the rbenv bin and shims directories can be added to the PATH before the server is started up. From what I've read, and managed to get working, the recommended method of providing rbenv on a deployment host is for each user to get their own `.rbenv` directory installation. In order to share installed rubies you'd then install rbenv to `/usr/local/share/rbenv` and then symlink the rubies from `/usr/local/share/rbenv/versions` to `~/.rbenv/versions`.

The process of getting this working with Linux scripts should be roughly the same as that given in the `rc.d-unicorn.erb` script, checking for the existence of the directory and then prepending to the PATH.