“rails -s” vs. “rails s”

I was running through the most excellent Ruby on Rails Tutorial 7th Ed. (by Michael Hartl) and wanted to launch the development web server. However, I mis-typed the command.

“rails -s”

brianvagnini@Brians-Mac-mini-2 sample_app % rails -s

Running 2 tests in a single process (parallelization threshold is 50)

Run options: –seed 49801

# Running:

..

Finished in 0.391693s, 5.1060 runs/s, 5.1060 assertions/s.

2 runs, 2 assertions, 0 failures, 0 errors, 0 skips

Vs.

“rails s” (Starts the development web server)

brianvagnini@Brians-Mac-mini-2 sample_app % rails s

=> Booting Puma

=> Rails 7.0.7 application starting in development 

=> Run `bin/rails server –help` for more startup options

Puma starting in single mode…

* Puma version: 5.6.6 (ruby 3.1.2-p20) (“Birdie’s Version”)

*  Min threads: 5

*  Max threads: 5

*  Environment: development

*          PID: 2099

* Listening on http://127.0.0.1:3000

* Listening on http://[::1]:3000

Use Ctrl-C to stop

So what does this mean?

Apparently , the “-s” option (per rails -help command) means

”    -s, –silent     Like –quiet, but also suppresses the ‘in directory’ announcement.”

”   -q, –quiet                      Do not log messages to standard output.”

Running “rails” by itself yields:

brianvagnini@Brians-Mac-mini-2 sample_app % rails

The most common rails commands are:

  •  generate     Generate new code (short-cut alias: “g”)
  •  console      Start the Rails console (short-cut alias: “c”)
  •  server       Start the Rails server (short-cut alias: “s”)
  •  test         Run tests except system tests (short-cut alias: “t”)
  •  test:system  Run system tests
  •  dbconsole    Start a console for the database specified in config/database.yml (short-cut alias: “db”)
  •  new          Create a new Rails application. “rails new my_app” creates a new application called MyApp in “./my_app”
  •  plugin new   Create a new Rails railtie or engine

All commands can be run with -h (or –help) for more information.

In addition to those commands, there are:

  •   about
  •   action_mailbox:ingress:exim
  •   action_mailbox:ingress:postfix
  •   action_mailbox:ingress:qmail
  •   action_mailbox:install
  • (continuing through to )
  •   turbo:install:redis
  •   version
  •   yarn:install
  •   zeitwerk:check

Other useful sources:

https://gist.github.com/mdang/95b4f54cadf12e7e0415

https://guides.rubyonrails.org/command_line.html

Leave a comment

Your email address will not be published. Required fields are marked *