From 7193cf3be1f4e2fcec8a59a0dd746c5fb7157b8d Mon Sep 17 00:00:00 2001 From: Agis Anastasopoulos Date: Thu, 3 Aug 2017 19:03:39 +0300 Subject: [PATCH] Warn if Spring is running in production Fixes #318 --- lib/spring/application.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/spring/application.rb b/lib/spring/application.rb index 827b333e..5fc752f4 100644 --- a/lib/spring/application.rb +++ b/lib/spring/application.rb @@ -173,7 +173,17 @@ def serve(client) IGNORE_SIGNALS.each { |sig| trap(sig, "DEFAULT") } trap("TERM", "DEFAULT") - STDERR.puts "Running via Spring preloader in process #{Process.pid}" unless Spring.quiet + unless Spring.quiet + STDERR.puts "Running via Spring preloader in process #{Process.pid}" + + if Rails.env.production? + STDERR.puts "WARNING: Spring is running in production. To fix " \ + "this make sure the spring gem is only present " \ + "in `development` and `test` groups in your Gemfile " \ + "and make sure you always use " \ + "`bundle install --without development test` in production" + end + end ARGV.replace(args) $0 = command.exec_name