Hosting git-wiki with Phusion Passenger

I recently converted my server to use Phusion Passenger to host my Rails and Rack applications. Phusion Passenger has pretty good for Rack applications and Sinatra but I was running into a lot of issues with hosting my git-wiki. After some debugging, I found git-wiki wasn’t loading the view path correctly while hosted under Passenger. With a quick change to my config.ru file, I was able to force git-wiki to load the view properly. Here’s my current configuration for my running wiki, I hope it helps someone else who has a similar issue:

require 'sinatra/lib/sinatra'
require 'rubygems'
 
ENV['WIKI_HOME'] = '/home/websites/wiki.www.freelancingdigest.com/wiki'
 
Sinatra::Application.default_options.merge!(
  :run => false,
  :env => ENV['RACK_ENV'],
  :raise_errors => true,
  :views => '/home/websites/wiki.www.freelancingdigest.com/application/views'
)
 
require 'git-wiki.rb'
 
run Sinatra.application
 

Eric