rvm / rvm1-ansible

The official ansible RVM role to install and manage your Ruby versions.
MIT License
271 stars 136 forks source link

If running play locally, user needs to logout and log back in to get RVM in their $PATH #64

Open lyoshenka opened 8 years ago

lyoshenka commented 8 years ago

The easy solution is to add a message that warns about this. The better solution is to somehow set the $PATH correctly for the current user.

lyoshenka commented 8 years ago

Also, any gems installed before logging out and logging back in won't be in the $PATH either.

isikyus commented 1 year ago

The better solution is to somehow set the $PATH correctly for the current user.

I'm not sure this is possible. If you run ansible <some playbook that uses RVM> in a shell, Ansible runs as a subprocess of the shell; any environment variables it sets get set only for it and its children. As far as I know there's no way in Linux to reach up from a subprocess and set variables in a parent process. If there is a way I suspect it'd be quite complex.