RACK_ENV = ENV["RACK_ENV"] ||= "development" unless defined? RACK_ENV 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 %>