Bundler: Oh the fail I know.

First, a disclaimer: I don’t want to be negative. I am only writing this because I feel it deserves attention by the community and because I love Rails so much that the fact that something is making me lose faith in it truly makes me a little sad.

I first started using Bundler 0.7.6 in December ’09 in a Rails 2.3.5 project. We also use Bundler (not sure what version we started with) in our main Rails 2.3.x app that powers www.Goldstar.com. In the 3+ months that we have been using bundler, it has, by far, been the largest pain point and time sink of any part of our toolset to the point that today, I proclaimed on twitter, than in it’s current state, I can’t recommend Rails 3.0 to anyone starting or upgrading a product.

Now, if you know me, you know that this is pretty out-of-left-field. I’m a HUGE Rails evangelist. And I truly believe that it’s right for many projects in all kinds of scenarios.

Anyway, on to the fail. . .

Bundler 0.7.x had lots of issues, too numerous to count. However, it did have the option to pass a yaml file to it via –build-options that would allow you to pass a few arguments into the various gems it needed to build. This was good enough for us, and we followed the convention we use with database.yml to have all the correct options in the various environments we use to dev/deploy our rails apps.

Builder 0.8 soon followed suit (I believe in January) and messed us up by changing the path inside the bundler folder that all the gems where kept at to be name-spaced to what version of ruby you were using. I’m not sure what this was meant to fix, but it broke a few things for us and it broke Rubymine (my personal editor of choice). But hey, we upgraded.

I’m going to leave out all the pain that was causes by upgrading to 0.8 and just say that we are currently using Bundler 0.8 in dev and production, except that a bug, where older version of already cached gems won’t upgrade unless you rm -rf the bundler directory (json-pure-1.2.2 to json-pure-1.2.4 fwiw) is breaking our deploys to production. This means that every deploy to production, we can’t be sure the bug isn’t going to break it, so we must rebuild every gem in the app (of which there are MANY) every time we deploy. This just isn’t going to work for us.

Now, we’d like to move to Bundler 0.9 because it promises to fix our issue (bundle install correctly updates gems as required). However, –build-options has been removed from 0.9. Because –build-options was removed, bundler has moved to a don’t-vendor-some-of-your-gems solution where it will use gems from the system if they aren’t in the bundle. This allows you to pass different incantations to gem install for different gems (mysql, pg, etc) and it will use those already built gems when you later do bundle install. But that means we’re back to managing gem installs on all of our different systems in different ways, which was one of the few things that Bundler did significantly better than config.gem!

Our systems developer, Steven Baker, is currently working on re-implimenting a solution to the –build-options issue, which he first ran by “Carlhuda” in hopes that they might include it and we’re not going down a road that will just end in us playing by ourselves and having to re-impliment our Gemfile or build_options.yml file for whatever solution is, but this brings me to my point:

Rails 3.0, because it relies on Bundler, is not in anyway stable/useable/suggested unless you want to pretty continuously fix/re-impliment/cry yourself to sleep because of Bundler. Carl L. has posted a roadmap which shows at least 2 more revisions as well as closing 20+ currently open issues. I have no idea what the issue velocity is on the project, but to me, it looks like it’s in the months and not days or weeks before Bundler is going to be stable. And, as with every version before it, there have been major downsides to the implementation, that have forced pretty major breaking changes. In other words, every version of bundler is a new experiment (not to mention the various gem management techniques that merb used which were also a source of headaches), and I have little confidence that just slapping 0.9 or 0.10 is going to change that.

Bottom line: A significant piece of Rails 3 is still in the “spike” phase, and shows little to no promise that it will become solid enough to trust for months.

Please skip the “Patches are accepted” (we’re working on one kthxbye) and “Why are you even using bundler?” (troll). I’m not here to indict or blame anyone, just to report our experience and clarify why I’ve lost significant confidence in Rails because numerous people have asked.

Sidenote: I’m putting this at the bottom, because it’s secondary to the point of the post, but why, precisely, do we have to use Bundler to make Rails 3 work? Who made this decision? If it was the same people that wrote Bundler, doesn’t anyone see a problem with that (NIH)? I’m assuming there were discussions in the rails-high-council private campfire room at some point, but obviously us peons aren’t privy to those. Config.gem wasn’t the easiest thing to use, but I’ve successfully used it for close to a year with very few issues and had it’s eccentricities worked out pretty well. To have it completely removed from Rails 3, and replaced by an experiment, seems a bit premature.