Skip to content

Instantly share code, notes, and snippets.

@jdee
Created January 13, 2011 13:37
Show Gist options
  • Save jdee/777858 to your computer and use it in GitHub Desktop.
Save jdee/777858 to your computer and use it in GitHub Desktop.
an entire Rails 3 boot.rb file
require 'rubygems'
# Set up gems listed in the Gemfile.
gemfile = File.expand_path('../../Gemfile', __FILE__)
begin
ENV['BUNDLE_GEMFILE'] = gemfile
require 'bundler'
Bundler.setup
rescue Bundler::GemNotFound => e
STDERR.puts e.message
STDERR.puts "Try running `bundle install`."
exit!
end if File.exist?(gemfile)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment