diff options
Diffstat (limited to 'config/boot.rb')
-rw-r--r-- | config/boot.rb | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/config/boot.rb b/config/boot.rb index 02baeab29ab..84f390f3228 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,17 +1,11 @@ -require 'rubygems' - -# Set up gems listed in the Gemfile. -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +def rails5? + %w[1 true].include?(ENV["RAILS5"]) +end -require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) +require 'rubygems' unless rails5? -begin - require 'bootsnap/setup' -rescue SystemCallError => exception - $stderr.puts "WARNING: Bootsnap failed to setup: #{exception.message}" -end +gemfile = rails5? ? "Gemfile.rails5" : "Gemfile" +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../#{gemfile}", __dir__) -# set default directory for multiproces metrics gathering -if ENV['RAILS_ENV'] == 'development' || ENV['RAILS_ENV'] == 'test' - ENV['prometheus_multiproc_dir'] ||= 'tmp/prometheus_multiproc_dir' -end +# Set up gems listed in the Gemfile. +require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) |