I decided I give rbenv a shot. This change also means I have to find another way to separate rails gems from my standard ones. I’ll tell you why.
YMMV, but I have a couple of rails projects in my development directory. These are not necessarily on the same rails version. I have a 2.3, some 3.0, and some 3.1 rc used in my projects. Therefore I just can’t put all these gems into a single place. How my project selects the correct version of
rails command? Hint: gem versioning is not a solution.
For my first problem, I found vendoring gems with style pretty useful.
In my opinion, rbenv fits perfectly to Ryan McGeary’s solution. Please put your project
.rbenv file into source control.
Of course, from time to time I want to fire up a clean rails app for prototyping, and this is when I use gemsets. I could use rbenv-gemset from Jamis Buck too, but it’s just too much for my taste either.
My answer here is rails nursery (of course this applies to every ruby-related package, which requires some code generation):
That’s it. You switch to the nursery directory (in my case it’s
~/Code/rails-nursery-3.1.0.rc6), and you’ll have the minimum requirements for creating a new 3.1.0rc6 rails app:
Now you have a separate directory for all the gems you might not want in the future, and be honest: it’s much easier to get rid of this directory, than cherry-picking your installed gems.