#!/usr/bin/env ruby #Add the currently running directory to the start of the load path $:.unshift './' #Don't buffer stdout $stdout.sync = true begin require 'app.rb' rescue LoadError => e require 'rubygems' path = File.expand_path '../../lib', __FILE__ $:.unshift(path) if File.directory?(path) && !$:.include?(path) require 'app.rb' end