From 36bedfb7f37931a33d9af586296404c02c3ab80e Mon Sep 17 00:00:00 2001 From: blackst0ne Date: Thu, 22 Mar 2018 09:37:57 +1100 Subject: [Rails5] Update files by `rails app:update` --- config/boot.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'config/boot.rb') diff --git a/config/boot.rb b/config/boot.rb index f2830ae3166..84f390f3228 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,6 +1,11 @@ -require 'rubygems' +def rails5? + %w[1 true].include?(ENV["RAILS5"]) +end -# Set up gems listed in the Gemfile. -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +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']) -- cgit v1.2.3