Day 1: Building a Bookmarking Application

In our first day of learning Sinatra, we’ll begin by setting up a “Hello, world” example to make sure our environment is working properly. We’ll also see how we can write automated tests that exercise the code we wrote. Without any further ado, we’ll jump into creating a sample application that we’ll grow throughout the chapter as we discover more of Sinatra’s features.

Let’s start by saying hello to Sinatra.

Hello, Sinatra

From your command line, make sure you have Ruby and RubyGems installed:

$ ​ruby -v
ruby 2.0.0
$ ​gem -v

We’re using Ruby 2.0, but Sinatra works just as well with Ruby 1.9. If these commands do not work, visit the Ruby download page to install Ruby for your operating ...

Get Seven Web Frameworks in Seven Weeks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.