From 2f75078758c5740751f9e436d414e6d07c58de5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lourens=20Naud=C3=A9?= Date: Sun, 7 Dec 2014 23:28:38 +0000 Subject: [PATCH] Do not assume all interpreter versions support allocation tracing --- config/boot.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/boot.rb b/config/boot.rb index afa16ad5afd..517524d879c 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,6 +1,10 @@ if ENV['DISCOURSE_DUMP_HEAP'] == "1" require 'objspace' - ObjectSpace.trace_object_allocations_start + begin + ObjectSpace.trace_object_allocations_start + rescue NoMethodError + puts "Heap dumps not available for Ruby #{RUBY_VERSION} (> 2.1 required)" + end end require 'rubygems'