Skip to content

Instantly share code, notes, and snippets.

@RyanScottLewis
Created May 4, 2011 08:02
Show Gist options
  • Select an option

  • Save RyanScottLewis/954901 to your computer and use it in GitHub Desktop.

Select an option

Save RyanScottLewis/954901 to your computer and use it in GitHub Desktop.
Check for bundler
begin
require 'bundler'
Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
$stderr.puts e.message
$stderr.puts "Run `bundle install` to install dependencies"
exit e.status_code
rescue Gem::LoadError => e
$stderr.puts e.message
$stderr.puts "Run `gem install bundle` to install bundler"
$stderr.puts "Then, run `bundle install` to install dependencies"
exit e.status_code
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment