Reputation: 1073
Is there a way to associate a specific ruby version with a specific branch ?
I would like to have:
git checkout branch-a #ruby -v = 1.8.7
git checkout branch-b #ruby -v = 1.9.2
Thanks
Upvotes: 4
Views: 442
Reputation: 1368
This can be done by setting up RVM to use .rvmrc and setup automatic reloading of rvmrc files.
After installation of RVM, setup Ruby versions for each branch, eg:
rvm --rvmrc --create use ruby-1.8.7
Also add the automatic .rvmrc reloading, since .rvmrc files will only be reloaded on cd into a directory otherwise, see this gist: https://gist.github.com/2145979
Upvotes: 0
Reputation: 42923
You can have different .rvmrc
s in each branch, but that requires to change the directory to become active.
git checkout whatever && cd .
Upvotes: 3