Skip to content

Instantly share code, notes, and snippets.

@pk
Created February 16, 2010 12:25
Show Gist options
  • Save pk/305490 to your computer and use it in GitHub Desktop.
Save pk/305490 to your computer and use it in GitHub Desktop.
Merb config.ru for Unicorn, Passenger and others
begin
require ::File.expand_path('.bundle/environment', __FILE__)
rescue LoadError
require 'rubygems'
require 'bundler'
Bundler.setup
end
require 'merb-core'
Merb::Config.setup(:merb_root => ::File.expand_path(::File.dirname(__FILE__)),
:environment => ENV['RACK_ENV'])
Merb::BootLoader.run
# use PathPrefix Middleware if :path_prefix is set in Merb::Config
if prefix = ::Merb::Config[:path_prefix]
use Merb::Rack::PathPrefix, prefix
end
# comment this out if you are running merb behind a load balancer
# that serves static files
use Merb::Rack::Static, Merb.dir_for(:public)
run Merb::Rack::Application.new
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment