Skip to content


Subversion checkout URL

You can clone with
Download ZIP
The Fastest way to start using Twilio with Ruby
Branch: master

fixed dumb typo

latest commit dbf5bd55bc
Oscar Sanchez authored
Failed to load latest commit information.
views ninja status... finished layout, and still fully functional
.gitignore client set up. changed way of storing account info. will improve later
app.rb Fixed up the local testing format. No more local_setings.rb

Twilio HackPack for Heroku and Sinatra

An easy-to-use repo to kickstart your Twilio app using Sinatra and deploy onto Heroku. This is a Ruby port of Rob Spectre's Twilio Hackpack for Python, so check that out if you don't like Ruby (what's wrong with you!?)


What this can do for you!

  • Automatic Configuration - running configure.rb will help you set up your whole Twilio/Sinatra/Heroku app environment!
  • Local Development Easy - bundle install will help you get any necessary gems
  • Hackable - easy to read code and easy to modify all in app.rb
  • Twilio Client - Want to call something from your browser? Gotcha covered!
  • Testing - working on those... not ready yet


The hackpack contains endpoints for Twilio Voice and SMS apps. Check out how to edit the '/voice' and '/sms' routes in app.rb

Say an app that plays some Kooks:

post '/voice/?' do
  response = do |r|
    r.Play ""

Or an app that will tell you how sweet this hackpack is:

post '/sms/?' do
  respose = do |r|
    r.Sms "This Hackpack is pretty sweet!"

All regular Twilio, TwiML, and Ruby logic applies, and to get a better understanding on how to use the Twilio Ruby gem, check it out here


Step-by-step on how to deploy, configure, and develop using this hackpack.

Getting Started

1) Grab latest source:

git clone git://

2) Navigate to folder and create a Heroku Cedar stack:

heroku create --stack cedar

3) Configure your Twilio information: Check out the Configuration section below

4) Deploy to Heroku:

git push heroku master

5) Check out your new app!

heroku open


You can use this hackpack with a ton of configurable options whether you have a Twilio number, application id, or not. To get a feel for what can happen, take a look at:

ruby configure.rb -h

Automatic Configuration

You'll first want to run bundle install to obtain the required Ruby gems to get this hackpack up and running. Other than that, the hackpack itself can do anything from buying you a new Twilio phone number, creating a new application, or configuring your account SID and auth token.

1) At the beginning, run:

ruby configure.rb --sid ACXXXXXXX --token YYYYYYYY

2) For local development, copy and paste the commands the configure script provides

export TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxx
export TWILIO_AUTH_TOKEN=yyyyyyyyyyyyyyyyy
export TWILIO_APP_SID=APzzzzzzzzzzzzzzzzzz
export TWILIO_CALLER_ID=+15556667777

3) Launch webserver:

foreman start

4) Tweak away on app.rb


If you have any questions/suggestions/feedback, email me at


  • Tests...
  • Modify app template for easier changes or adding of pages
Something went wrong with that request. Please try again.