Other Pages

Running Your Application Locally

Goals

  • Let's stop and start the server

Steps

Step 1

Let's stop the server

Type this in the shell:
.... TODO ....

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

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 3

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

See your web app actually running!

Step 4

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: 2022-07-01 15:25:32 +0200 ===
- Goodbye!
Exiting
The greyed-out text may differ and is not important.

Explanation

rails server ran your application locally just like Heroku will be running it on their servers.

This provides a very simple means to see your changes before you commit and push them to Heroku.

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

Next Step: