From 1adda31cbc6ae26d94191bf11d8165297b8d24c0 Mon Sep 17 00:00:00 2001
From: Sam Saffron <sam.saffron@gmail.com>
Date: Thu, 16 Apr 2015 16:13:48 +1000
Subject: [PATCH] travis likes old bundler

---
 Gemfile   |  2 ++
 bin/rails | 18 +++++++++++++++---
 bin/rake  | 18 +++++++++++++++---
 3 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/Gemfile b/Gemfile
index 14b81a28c..50a64cb13 100644
--- a/Gemfile
+++ b/Gemfile
@@ -250,6 +250,8 @@ begin
   gem 'memory_profiler', require: false, platform: [:mri_21, :mri_22]
 rescue Bundler::GemfileError
   STDERR.puts "You are running an old version of bundler, please upgrade bundler ASAP, if you are using Discourse docker, rebuild your container."
+  gem 'stackprof', require: false, platform: [:mri_21]
+  gem 'memory_profiler', require: false, platform: [:mri_21]
 end
 
 gem 'rmmseg-cpp', require: false
diff --git a/bin/rails b/bin/rails
index 728cd85aa..657440d20 100755
--- a/bin/rails
+++ b/bin/rails
@@ -1,4 +1,16 @@
 #!/usr/bin/env ruby
-APP_PATH = File.expand_path('../../config/application',  __FILE__)
-require_relative '../config/boot'
-require 'rails/commands'
+#
+# This file was generated by Bundler.
+#
+# The application 'rails' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'pathname'
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
+  Pathname.new(__FILE__).realpath)
+
+require 'rubygems'
+require 'bundler/setup'
+
+load Gem.bin_path('railties', 'rails')
diff --git a/bin/rake b/bin/rake
index 17240489f..26c7a2d5b 100755
--- a/bin/rake
+++ b/bin/rake
@@ -1,4 +1,16 @@
 #!/usr/bin/env ruby
-require_relative '../config/boot'
-require 'rake'
-Rake.application.run
+#
+# This file was generated by Bundler.
+#
+# The application 'rake' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
+
+require 'pathname'
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
+  Pathname.new(__FILE__).realpath)
+
+require 'rubygems'
+require 'bundler/setup'
+
+load Gem.bin_path('rake', 'rake')