Skip to content

Instantly share code, notes, and snippets.

@rdj
Created September 13, 2011 01:01
Show Gist options
  • Select an option

  • Save rdj/1212895 to your computer and use it in GitHub Desktop.

Select an option

Save rdj/1212895 to your computer and use it in GitHub Desktop.
check bundler version when deploying to make sure you're not deploying with old cap recipes
# You could hard-code this, but we keep the current bundler version
# everybody is supposed to use in a default.gems file. So you can
#
# rvm gemset empty
# rvm gemset import
# bundle install --local
#
# And you're in a known good state.
expected_bunder_version = File.read( File.join( File.dirname( __FILE__ ), '..', 'default.gems' ) ).match( 'bundler -v(\S+)' )[1]
if Bundler::VERSION != expected_bunder_version
abort "Refusing to deploy with Bundler v#{Bundler::VERSION} (expecting v#{expected_bunder_version})"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment