Skip to content

Instantly share code, notes, and snippets.

@vangberg
Created May 30, 2009 15:00
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save vangberg/120525 to your computer and use it in GitHub Desktop.
Save vangberg/120525 to your computer and use it in GitHub Desktop.
minimal sinatra rackup
require 'sinatra'
get '/' do
"Hello world"
end
require 'rubygems'
require 'app'
run Sinatra::Application
@JGrubb
Copy link

JGrubb commented Jul 6, 2014

Thank you.

@devsli
Copy link

devsli commented Jan 12, 2015

require 'app'

might be replaced with

require './app'

In case of error

cannot load such file -- app (LoadError)

@alkrauss48
Copy link

Thanks for this. And thanks @devsli - that helped me.

@h8rry
Copy link

h8rry commented Aug 11, 2015

Thanks!

@maslenkov
Copy link

Thanks a lot!

P.S. ruby has additional method to require files by relative path - require_relative. Checkout docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment