ruby! food! kids! … and other fun from terry heath
RSS icon Email icon Home icon
  • Bling Bling gem management

    Posted on February 20th, 2010 terry 9 comments

    With Rails 3 and 2.3.5, I’ve been trying to use Bundler, but it’s been pretty painful so far. It’s not lightweight, and the only problem I really had with config.gem was that it had to load up the Rails environment to run, which meant if you had some code that was out in the open referencing a module or class in a gem that wasn’t yet installed, it borked (AASM did this to us). This made rake gems:install useless for lots of things.

    After jumping through the bajillion hoops and kludges to get mongomapper working, RSpec started giving me some problems with bundler, so I set out last night to make something really simple, just to manage gems, Bling.

    It’s not nearly as feature-rich as Bundler. It won’t unpack your gems or cache them, and it wants to install all gems to your system. So if those features are important to you (and they probably are to a lot of people), bling isn’t for you.

    Bling just uses a yaml file (in Rails.root, for Rails projects) to keep up with gems, and lets you specify gems, their versions, their sources, and what lib to require (if not easily guessed as the gem name).

    I bet I’ll have to add features to it as I go, but it’s solved the few problems I’ve had so far.

    To get started, just do a “(sudo) gem install bling” and then in your Rails directory to a “bling init”. Once you’ve set up your bling.yml how you want, if you have any new gems, just do a “bling install”.

    Gem info is here. GitHub is here.


    9 responses to “Bling Bling gem management” RSS icon

    • Sounds like you have pretty much duplicated the functionality of Chad Woolley’s geminstaller. Yay for NIH DIY. If you need something that just works until Bundler is stable enough, I’d say use geminstaller. We already have at least five gem packaging/installing things that mostly do the same thing. I don’t think we need another, and I’d guess your time would be better spent creating new value rather than reinventing the wheel.

    • @Josh
      Whoah, awesome. Looks like geminstaller does exactly what I need and is more stable than what I’ve put up.


    • Hey,

      So, have you at least submitted issues regarding your pains or asked us for help in #carlhuda on freenode? I can sympathize with you about pains using it right now as it still has not hit a stable release, but throwing out words like “bloated”, making an angry blog post, and rewriting a tool that the original author has already happily left in the dust in favor of bundler seems a bit rash.

      If you are still interested in giving bundler a shot, please let us know in #carlhuda what bugs you are hitting and we’ll fix them within a day or so. We actually are really quick with bug fixes, and listen to everybody that stops by with questions / problems.


    • @Carl

      When Mongo and RSpec and Nokogiri work easily with Bundler, I’ll be pretty happy to work with it again. I imagine as everyone hammers out Rails3 apps and it approaches non-beta, and Bundler hits 1.0, things might be significantly better.

      By calling Bling and geminstaller “lightweight,” it could be interpreted as viewing Bundler as “bloated,” (though I never wrote that) but really I just think that Bundler is solving a lot of problems I haven’t run into.

    • “Bundler is solving a lot of problems I haven’t run into”

      Exactly. Problems that you won’t even encounter until you unshelve an app months or years down the road, and find out that the world has moved on and it is impossible to get your dependencies into a working state (they may not even exist if the author has deleted them from Gemcutter willy-nilly). If you have never encountered that problem, you won’t really appreciate that Bundler solves it for you.


    • Oh good grief, flame a guy for writing a piece of software that is useful to him (because something else isn’t yet) and bloging. Isn’t that the whole point of “community”?

    • Besides, the project name is awesome.

    • Thats exactly what i need, also had the same problems with bundler, just too complicated. Great work!

    • hmm its the right direction, but e.g. supporting bundler like Gemfile format would be a better choice imo(or supporting rails config.gem format…), also rails 2.3 instructions are missing and it will not notify you when you are using a gem that was not listed in the bling.yml