Other Pages

Running Your Application Locally

Goals

  • Let's start and stop the server

Steps

Step 1

Let's start the server

Type this in the shell:
rails server

This will print some stuff and stay running forever, printing more stuff every time you visit a page in your app. This terminal is blocked now, you will need another terminal for other work.

Step 2

Point your web browser to http://localhost:3000

See your web app actually running!

Step 3

While the server is running, whatever you type in that terminal tab will be ignored.

To get back to the terminal, you can stop the server by typing Control-c.

Approximate expected result:
=== puma shutdown: 2024-10-22 15:25:32 +0200 ===
- Goodbye!
Exiting
The greyed-out text may differ and is not important.

Explanation

rails server ran your application locally.

Control-c is a way of closing or cancelling terminal programs. Since rails server runs forever, you need to interrupt it with Control-c.

Take Away

From now on take care of keeping the server running while you are developing and want to try out the application in the browser

Next Step: