I’m working on a project that runs on Rails ~> 3.0 on the master branch, and ~> 3.1 on another branch.
Obviously those 2 branches need different gemsets.
Do you know of a convenient way of handling the situation using RVM?
I’ve thought of a couple options, none of them optimal:
-
using
gemsets I would have to remember to manually switchgemsetafter eachgit checkout -
using
bundle packageI would have to track thevendor/bundledirectory -
a mix of the two approaches is not even possible, since
.bundle/configis not tracked -
I could write a
gitpost-checkouthook, but it sounds a bit hacky (hardcoded branch names and all that)
Is there a better way that I’m failing to think of?
I ended up using the following
git post-checkoutscript.In the
masterbranch, I was using gems installed in$GEM_HOME. In the other branches, gems were installed locally tovendor/cache.