Starting the application

Earlier, we used to write the following on our command line to start our application:

ruby <filename>

For our current project, the main file is app.rb. As we also have a rackup file, we should start our application through that file:


This will execute and start the server. We will see something like this on our command line. This says that the Sinatra server is ready and listening for requests on port 4567 for the development deployment:

Starting the application

However, we have not defined our routes yet. So, all requests sent to this server would fail. We can define a few routes to check whether our application is running or ...

Get Learning Sinatra now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.