LocalBundler

June 04, 2013
I've been using the local path option with Bundler for some time now and it works really well. I use RubyMine and it won't browse . directories, so rather than using the .bundle dir for the local install path, I've taken to using ‘zz’ so I can still get all of the good RubyMine goodness for spelunking gem code while making sure gems are grouped at the bottom of my search results. Working on a project in the midst of a Ruby upgrade, it's also nice to have groups of 1.8 and 1.9 gems installed separately in the zz/ruby/1.x/gems paths.

One thing I find myself doing on occasion when trying to sort out gem troubles is removing an entire gem's directory structure, mistakenly thinking that'll get bundler to re-install the gem on the next bundle call.

The problem is Bundler (or actually RubyGems) doesn't check the gem's installed directory for its presence, but just scans the specifications folder for .gemspec files. In order for my little trick to work, I not only need to blow away the gems directory structure in zz/ruby/1.x/gems/, but also its .gemspec file in zz/ruby/1.x/specifications.

It would be nice if a bundle reinstall command existed to do this. `bundle update` isn't what I want since that will update to the latest matching version.
comments powered by Disqus