1

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):

recipe[rvm::system]

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?

Clinton
  • 133
  • 6

2 Answers2

2

This appears to be a problem with the current version of RVM itself (1.17.0), forcing an older version of RVM solves the issue. I did this by setting the following attributes:

node['rvm']['version'] = "1.16.13"
node['rvm']['branch'] = "none"
Clinton
  • 133
  • 6
0

You installed ruby only for your user. You should use rvm::system_install for system wide installation.

Sacx
  • 2,541
  • 15
  • 13
  • Unfortunately this did not resolve the issue. From the documentation: This (recipe[rvm::system]) recipe includes default and system_install. So it would seem that I was already performing a system wide installation of RVM. system_install is used when I want to handle the installation of rubies myself. Not the case in this instance, happy to go with the default 1.9.3. – Clinton Nov 29 '12 at 00:35