How to configure independent rvmrc files across code lifecycle

72 Views Asked by At

We have multiple developers contribute to source code, so it would be preferable to have multiple .rvmrc files for each developer. How should I automate this?

e.g.

dev1 uses rvm use 1.9.3@app-dev1
dev2 uses rvm use 1.9.3@app-dev2
dev3 uses rvm use 1.9.3@app-dev3

How do I maintain and modify .rvmrc for individual developers. Should this file be in source code repository

1

There are 1 best solutions below

0
On BEST ANSWER

THe rvmrc file could be a bash script, therefore you could use the USER environment variable in there to select the gemset you want to use.

You can create an example rvmrc with the following command:

rvm rvmrc create @app-dev

Then you can easily modify the environment_id in the generated .rvmrc file to achieve the desired behavior:

environment_id="ruby-1.9.3@app-dev-${USER}"

So you could have only one rvmrc for every developer and it will select the right gemset.