What are the differences between using `rails server` and `rackup`?
Asked Answered
G

1

9

The only difference I've noted is that rails server starts the server on port 3000, while rackup starts the server on port 9292.

Are there any other differences?

Are there use cases for one instead of the other?

Glomerulus answered 21/2, 2012 at 18:51 Comment(0)
A
18

rails server is the command for starting your server (usually WEBrick) and is in rails.

rackup is a command that comes with the rack middle and uses the settings in your config.ru and starts a server based off of those. This is a standard (it will work for other frameworks and rack-based applications) and is usually used in production servers.

One difference of note is that if you start a server with rails s then you will see the output in the terminal.

In my experience, in production, rackup is used by phusion passenger so you wouldn't want rails s in that situation.

As an aside, the port can be changed with both rails server and rackup using the -p flag.

Acapulco answered 21/2, 2012 at 19:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.