RACK_ENV = ENV["RACK_ENV"] ||= "development" unless defined? RACK_ENV ENV['DATABASE_URL'] = 'your_database_here' require File.dirname(__FILE__) + '/app.rb' FileUtils.mkdir_p 'log' unless File.exists?('log') log = File.new("log/sinatra.log", "a") $stdout.reopen(log) $stderr.reopen(log) run <%= @class_name %>