Docs header transparent bg

Using Bundler with Sinatra

Let's say you wanted to run the following Sinatra app.
class MySinatraApp < Sinatra::Base
  get "/" do
    "Hello Bundler"

To use bundler with a Sinatra application, you only need to do two things. First, create a Gemfile.
source ""
gem "sinatra", :require => "sinatra/base"

Then, set up your file to load the bundle before it loads your Sinatra app.
require 'rubygems'
require 'bundler'


require './my_sinatra_app'
run MySinatraApp

Start your development server with rackup, and Sinatra will be loaded via Bundler.
$ rackup
Edit this document on GitHub if you caught an error or noticed something was missing.