Using rvm and git, can I associate a ruby version with each branch?
Is there a way t开发者_C百科o 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
You can have different .rvmrc
s in each branch, but that requires to change the directory to become active.
git checkout whatever && cd .
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
精彩评论