Sinatra

edit by double-clicking content
edit this page

GetSinatra

Ruby Gems

sudo gem install sinatra

Your first Sinatra app


require "rubygems" 
require "sinatra" 

get '/' do
    "Hello World" 
end

now:

ruby myapp.rb

then: ..

http://localhost:4567

Bleeding Edge

  1. cd where/you/keep/your/projects
  2. git clone git://github.com/bmizerany/sinatra.git
  3. cd your_project
  4. ln -s ../sinatra
  5. git submodule init && git submodule update
  6. rake test

at the top of your sinatra.rb file

$:.unshift File.dirname(__FILE__) + '/sinatra/lib'
require 'sinatra'

get '/about' do
  "All good in the hood" 
end