aboutsummaryrefslogtreecommitdiffstats
path: root/railties/CHANGELOG.md
diff options
context:
space:
mode:
authorGenadi Samokovarov <gsamokovarov@gmail.com>2018-02-19 20:31:56 +0200
committerGenadi Samokovarov <gsamokovarov@gmail.com>2018-03-04 17:50:29 +0200
commit5af643d8d6f8af19a85a34475f40ac18db7c71e9 (patch)
treee32e0f33589c49b06d523ce514e1263097fb0adb /railties/CHANGELOG.md
parent22a67927f1c3e0fbc6a77b9b1c8892166a171c78 (diff)
downloadrails-5af643d8d6f8af19a85a34475f40ac18db7c71e9.tar.gz
rails-5af643d8d6f8af19a85a34475f40ac18db7c71e9.tar.bz2
rails-5af643d8d6f8af19a85a34475f40ac18db7c71e9.zip
Introduce explicit rails server handler option
I mistype `rails server production` instead of `rails server -e production` expecting to lunch a server in the production environment all the time. However, the signature of `rails server --help` is: ``` Usage: rails server [puma, thin etc] [options] ``` This means that the `production` argument is being interpreted as a Rack server handler like Puma, Thin or Unicorn. Should we argue for the `rails server production`? I'm not sure of the reasons, but the `rails console production` behavior was deprecated in: https://github.com/rails/rails/pull/29358, so parity with the existing `rails console production` usage may not hold anymore. In any case, this PR introduces an explicit option for the Rack servers configuration. The option is called `--using` (or `-u` for short) to avoid the `rails server --server` tantrum. The new interface of `rails server` is: ``` Usage: rails server [using] [options] Options: -p, [--port=port] # Runs Rails on the specified port - defaults to 3000. -b, [--binding=IP] # Binds Rails to the specified IP - defaults to 'localhost' in development and '0.0.0.0' in other environments'. -c, [--config=file] # Uses a custom rackup configuration. # Default: config.ru -d, [--daemon], [--no-daemon] # Runs server as a Daemon. -e, [--environment=name] # Specifies the environment to run this server under (development/test/production). -u, [--using=name] # Specifies the Rack server used to run the application (thin/puma/webrick). -P, [--pid=PID] # Specifies the PID file. # Default: tmp/pids/server.pid -C, [--dev-caching], [--no-dev-caching] # Specifies whether to perform caching in development. [--early-hints], [--no-early-hints] # Enables HTTP/2 early hints. ``` As a bonus, if you mistype the server to use, you'll get an auto-correction message: ``` $ rails s tin Could not find handler "tin". Maybe you meant "thin" or "cgi"? Run `rails server --help` for more options. ```
Diffstat (limited to 'railties/CHANGELOG.md')
-rw-r--r--railties/CHANGELOG.md18
1 files changed, 18 insertions, 0 deletions
diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md
index a38888afe5..335eb6c4e3 100644
--- a/railties/CHANGELOG.md
+++ b/railties/CHANGELOG.md
@@ -1,5 +1,23 @@
## Rails 6.0.0.alpha (Unreleased) ##
+* Deprecate passing Rack server name as a regular argument to `rails server`.
+
+ Previously:
+
+ $ bin/rails server thin
+
+ There wasn't an explicit option for the Rack server to use, now we have the
+ `--using` option with the `-u` short switch.
+
+ Now:
+
+ $ bin/rails server -u thin
+
+ This change also improves the error message if a missing or mistyped rack
+ server is given.
+
+ *Genadi Samokovarov*
+
* Add "rails routes --expanded" option to output routes in expanded mode like
"psql --expanded". Result looks like: