Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
33 lines (27 sloc) 771 Bytes
---
title: How to use Bundler with Sinatra
---
.container.guide
%h2 How to use Bundler with Sinatra
.contents
.bullet
.description
To use bundler with a Sinatra application, you only need to do two things. First, create a Gemfile.
:code
# lang: ruby
gem 'sinatra'
.bullet
.description
Then, set up your config.ru file to load the bundle before it loads your Sinatra app.
:code
# lang: ruby
require 'rubygems'
require 'bundler'
Bundler.require
require './my_sinatra_app'
run MySinatraApp
.bullet
.description
Start your development server with rackup, and Sinatra will be loaded via Bundler.
:code
$ bundle exec rackup