All in all, the transition was painless… in our development environments. Of course, in order to keep things on running smoothly on the continuous integration box, we amended our
rake cruise:spec task to start by running
sh "gem bundle".
So, wonderful! Any changes to our gem dependency list will picked up when cruise starts and made available for that “build”; there’s no need to log in and make any manual updates. Right?
Not quite. We’re using the disable_system_gems option and, in that case, Bundler (very intentionally) modifies your
GEM_PATH such that only “vendor’d” gems are available to the application. Which of course means that Bundler itself, being “a gem to bundle gems”, is unavailable when that
sh "gem bundle" command is run.
Our solution: bundle Bundler, obviously! That’s right, in our Bundler Gemfile we’ve included
gem "bundler". Now, after a single manual execution of
gem bundle to pick up the bundled Gem Bundler gem bundle (heh), any subsequent Gemfile changes (to gems other than Bundler) get picked up at the start of the build… and we’re cruisin’
Have another solution? Please let us know in the comments.
About the Author
BiographyMore Content by Pivotal Labs