summaryrefslogtreecommitdiff
path: root/config/boot.rb
blob: 655c54ddb849aecce34f39852b8b18c9ce2b123e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
def rails5?
  %w[1 true].include?(ENV["RAILS5"])
end

require 'rubygems' unless rails5?

gemfile = rails5? ? "Gemfile.rails5" : "Gemfile"
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../#{gemfile}", __dir__)

# Set up gems listed in the Gemfile.
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
begin
  require 'bootsnap/setup'
rescue LoadError
  # bootsnap is optional dependency, so if we don't have it it's fine
end