Skip to content

A platform for community discussion. Free, open, simple.

DEV: Update server startup warning to be more specific (#12949)

David Taylorac1d344368ee
diff --git a/bin/rails b/bin/rails
index f95c5282d16..595d7184197 100755
--- a/bin/rails
+++ b/bin/rails
@@ -10,17 +10,6 @@ if !ENV["RAILS_ENV"] && (ARGV[0] == "s" || ARGV[0] == "server")
ENV["RAILS_LOGS_STDOUT"] ||= "1"
- STDERR.puts <<~MESSAGE
- --------
- WARNING: Discourse uses `bin/unicorn` to start the web server.
- For backwards compatibility, `rails s` will do this automatically.
- For improved performance you should run `bin/unicorn` directly.
-
- Running:
- UNICORN_PORT=#{ENV["UNICORN_PORT"]} RAILS_LOGS_STDOUT=#{ENV["RAILS_LOGS_STDOUT"]} bin/unicorn
- --------
- MESSAGE
-
exec File.expand_path("unicorn", __dir__)
end
diff --git a/bin/unicorn b/bin/unicorn
index 6437aced5eb..106649c75f4 100755
--- a/bin/unicorn
+++ b/bin/unicorn
@@ -6,6 +6,12 @@ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
RAILS_ROOT = File.expand_path("../../", Pathname.new(__FILE__).realpath)
+if defined? Bundler
+ STDERR.puts <<~MESSAGE
+ WARNING: Using `bundle exec` to start the server is unnecessary, and will make startup slower. Use `bin/rails s` or `bin/unicorn`.
+ MESSAGE
+end
+
require 'rubygems'
require 'bundler/setup'
require 'digest'