Jay Fields blogged recently (and not for the first time) about managing gems within Rails projects. This is a problem a lot of people have wrestled with; there are close to a dozen plugins, rake tasks, uncommitted patches, and published hacks that attempt to provide a solution (and those are just the ones I know of).
FrozenGemsGenerator is the solution that we've been using on some projects at Relevance, and we're happy enough with it that we'll be using it more. It's a rails generator, packaged as a gem, that gives your Rails app a private gem repository, fully self-contained, and manageable just like your system-wide repository (except using script/gem
instead of gem
).
$ sudo gem install frozen_gems_generator
$ script/generate frozen_gems
$ script/gem install money
script/gem
supports all of the subcommands that the regular gem
command does.
I haven't yet implemented a solution for gems that install binary extensions. I'm very interested in suggestions for how best to solve that problem. Several of the other approaches have at least partial support for architecture-specific gems; the best may be Jeremy Voorhis' CarryOn plugin, which is also the solution that's closest in spirit to the FrozenGems approach. If you have ideas or suggestions about how architecture-specific gems should be handled, please add comments here or post them on our Trac instance.