fnichol/chef-rvm — Issue #73: RVM not souced in non-login shells on debian + derivates
Author: PizzaPill
Created: 2012-03-03 19:46:42+00:00
State: open

If you use a non-login shell, like chef-client debian and derivates like ubuntu don't read the contents of the rvm.sh file. RVM does/did even show a hint on those systems to make some changes to the .bashrc file. I'm a little lost as to where to set this in chef-rvm for different setup variants, otherwise I would have send a Pull Request. But here are the bits in pseudocode I'm using in my modified recipe:

for each user in the rvm-group, do:
```cd #{user_home_dir}
sed -i 's/\[ -z "\$PS1" \] \&\& return/\[ -z "\$PS1" \] \&\&/1' .bashrc```
and append this to the end of bashrc:
```echo << if [[ -s /#{user_home_dir}/.rvm/scripts/rvm ]] ; then source /#{user_home_dirh}/.rvm/scripts/rvm ; fi```