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?
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?
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.
© 2022 - 2024 — McMap. All rights reserved.