How to Use Sinatra to Build a Ruby Application

This page summarizes the projects mentioned and recommended in the original post on

Our great sponsors
  • PopRuby - Clothing and Accessories for Ruby Developers
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • - Learn 300+ open source libraries for free using AI.
  • WorkOS - The modern API for authentication & user identity.
  • Sinatra

    Classy web-development dressed in a DSL (official / canonical repo)

    Compared to Ruby on Rails, a full-stack web framework, Sinatra is a very lean micro-framework originally developed by Blake Mizerany to help Ruby developers build applications with "minimal effort".

  • Rack

    A modular Ruby web server interface.

    Because of its lightweight and Rack-based architecture, Sinatra is great for building APIs, mountable app engines, command-line tools, and simple apps like the one we'll build in this tutorial.

  • PopRuby

    PopRuby: Clothing and Accessories for Ruby Developers. Fashion meets Ruby! Shop our fun Ruby-inspired apparel and accessories designed to celebrate the joy and diversity of the Ruby community.

  • cost_calc_app

    A Sinatra app to help digital nomads know if they can afford to live in a city given how much they earn. This app was built to accompany the blog post "How to Use Sinatra to Build a Ruby Application"

    You can also get the full code for the example app here.

  • Thin

    A very fast & simple Ruby web server

    This one file contains everything needed for this simplified app to run. Run it with ruby main.rb, which should spin up an instance of the Thin web server (the default web server that comes with Sinatra). Visit localhost:4567 and you'll see the JSON response.

  • AppSignal

    🟥 AppSignal for Ruby gem

    Once you've successfully deployed your Sinatra app, you can easily use Appsignal's Ruby APM service. AppSignal offers an integration for Rails and Rack-based apps like Sinatra.

  • sinatra-datamapper

    A Sinatra extension for DataMapper support.

    Database adapter and ORM gems included in the Gemfile. We are using ActiveRecord for our app. Datamapper is another option you could use.

  • rubygems

    Library packaging and distribution for Ruby.

    # Gemfile source "" # Ruby version ruby "3.0.4" gem 'sinatra' gem 'activerecord' gem 'sinatra-activerecord' # ORM gem gem 'sinatra-contrib' gem 'thin' gem 'rake' gem 'faraday' group :development do gem 'sqlite3' # Development database adaptor gem gem 'tux' # gives you access to an interactive console similar to 'rails console' gem 'dotenv' end group :production do gem 'pg' # Production database adaptor gem end

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

  • Bulma

    Modern CSS framework based on Flexbox

    We also add a local copy of Bulma CSS and a custom stylesheet in public/css to provide styling for our app.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts