Skip to content
Rubigen based generator for new sinatra projects
Find file
Failed to load latest commit information.
app_generators/sinatra_app Help specified that 'test' was a valid value for the --test param, bu…
bin Fixed -v task for bin (require file was off)
lib Version bump
test Generate .gems file when using --heroku
.gitignore Unless --tiny is specified generate an app that < Sinatra::Application
Changelog updates to the gemspec, gemfile and changelog
Gemfile.lock changed version (duplicate effort)
History.txt Version Bump! 0.4.0 -> Check the history for new features
PostInstall.txt Updating README
README.rdoc Updated README
Rakefile updated rightly the version of rubigen




sinatra-gen generates a common file structure and basic app files for a web app utilizing the sinatra framework. For more information on sinatra, check out


sinatra-gen has a bunch of different options (based looseley on merb-gen) to try to not lock the user into any specific frameworks/dev practices.


sinatra-gen [appname] [options] [paths]


sinatra-gen mysinatrapp --vendor --init --test=shoulda --views=haml get:/ post:/:id

! Note: As of version 0.4.0 by default the sinatra app is placed in lib/appname.rb and is a subclass of Sinatra::Application. If you want 'classic' style apps (no class/module) use the –tiny option.


For even faster app development you specify actions to include in your app when generating. Actions are written out as


And are separated by spaces. For example:

get:/ post:/:id put:/update/*

Will be added you your app as:

get '/' do

post '/:id' do

put '/update/*' do

It will also generate test skeletons in the test framework of your choosing.


You can specify middleware to include by passing the filename(s) or class name(s), seperated by commas.

sinatra-gen myapp --middleware=rack/flash,Rack::Cache

Will place both the 'require' and 'use' statements in your app.

require 'rack/flash'
require 'rack/cache'


use Rack::Flash
use Rack::Cache


(can also be obtained by running sinatra-gen with no arguments):

   -v, --version                    Show the sinatra-gen version number and quit.
   -d, --vendor                     Extract the latest sinatra to vendor/sinatra
       --tiny                       Only create the minimal files.
       --init                       Initialize a git repository
       --heroku                     Create a Heroku app (also runs 'git init').
Optionally, specify the path to the heroku bin
       --cap                        Adds config directory with basic capistrano deploy.rb
       --scripts                    Install the rubigen scripts (script/generate, script/destroy)
       --test=test_framework        Specify your testing framework (bacon (default)/rspec/spec/shoulda/test)
       --views=view_framework       Specify your view framework (haml (default)/erb/builder)
       --middleware=rack-middleware Specify Rack Middleware to be required and included (comma delimited)
       --vegas, --bin=[bin_name]    Create an executable bin using Vegas. Pass an optional bin_name

General Options:

-h, --help                       Show this help message and quit.
-p, --pretend                    Run but do not make any changes.
-f, --force                      Overwrite files that already exist.
-s, --skip                       Skip files that already exist.
-q, --quiet                      Suppress normal output.
-t, --backtrace                  Debugging: show backtrace on errors.
-c, --svn                        Modify files with subversion. (Note: svn must be in path)
-g, --git                        Modify files with git. (Note: git must be in path)

The –tiny option will create no directories. Just an app.rb, a Rakefile, and a (Rackup file)


Big props to the Sinatra developers ( Also, thanks to Dr. Nic ( for the Rubigen and Newgem libraries


To use the –vendor option, git must be installed. To use the –bin/vegas option Vegas is required (sudo gem install vegas). To use the –heroku option, a Heroku account and the heroku gem is required (sudo gem install heroku).

To run the app without using the vendor option, the sinatra gem must be installed.


sudo gem install sinatra-gen

You can also install directly from github:

sudo gem install quirkey-sinatra-gen -s
Something went wrong with that request. Please try again.