opscode-cookbooks/application_ruby — pull request #14 by royratcliffe (2012-11-01 10:26:38+00:00)
Title: Unicorn Environment and Runit Service

I'm new to Chef and cookbooks and been working on Linux boxes where Ruby is __not__ found in the usual system-global places, i.e. when using Rbenv or RVM. Hence I found it necessary to monkey around with the Runit environment in order for the Rails app to successfully launch as a Runit service.

The modifications appearing in this pull request let you update the Unicorn provider's environment, which passes on to the `runit_service`; though perhaps it should take the environment from the enclosing application provider's environment.

The Runit service template adds an `-e` option with the path to the `/etc/sv/` _application name_ `/env` directory. This lets Runit configure the `PATH` so that Ruby once launched can find its binaries, especially if scripts have hash-bangs with `/usr/bin/env ruby`.