O'Reilly logo

Seven Web Frameworks in Seven Weeks by Frederic Daoud, Jack Moffitt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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
 
2.0.2

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required