I am try to install ruby gem using ansible. I use rvm for version management. The remote directory contain a rvmrc file to config the ruby and gemset version. However, when using ansible's command/shell module, it still uses the default ruby version, not the one instructed in rvmrc file. So my question is how can I execute command with correct ruby/gemset version?
3
votes
Are you sure that the command is being run from the home directory where you have the rvmrc file located? It sounds like there's a chance it's not. Try invoking a command to copy rvmrc to /tmp and see if it shows up there.
– Bruce P
Thank you for your reply, Bruce. I have used chdir option of command module. The chdir directory contains rvmrc file. I also use bash -lc '<ruby_command>' as the command, but no luck.
– Harue