I am using the chef-rvm cookbook by fnichol to perform a system wide installation of Ruby via RVM with the rvm::system recipe. I.e. In my run list, I have (with no additional attributes set):
After I cook my ubuntu server, everything works fine as a regular user. i.e.
$ ruby -v ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
However, rvmsudo doesn't seem to preserve the RVM environment, or correctly pass it on to sudo. I get the following error:
$ rvmsudo ruby -v sudo: ruby: command not found
How do I use chef to configure my environment so that rvmsudo has access to the ruby / gem environment?