EDIT 2: My patch to the Sinatra Book has been accepted. The instructions below can now be found in the book itself.
EDIT : I’ve created a page on the dreamhost wiki that includes this information.
There is a lot of good information on how to run Sinatra on Dreamhost, but after following all the excellent advice, I still ended up with Passenger failing to start with the following error :
can’t activate rack (>= 0.9.1, < 1.0, runtime), already activated rack-0.4.0
Luckily, the solution was pretty easy.
After following the instructions in the Sinatra book, all you need to do is configure where the Rack & Sinatra gems are loaded from. I chose to load them directly from my local gem repository, as this eliminates an additional step of unpacking the gem.
Here is what my config.ru looks like.
require '/home/USERNAME/.gem/ruby/1.8/gems/rack-0.9.1/lib/rack.rb'
require '/home/USERNAME/.gem/ruby/1.8/gems/sinatra-0.9.1/lib/sinatra.rb'
require 'YOUR-APPLICATION'
log = File.new("log/sinatra.log", "w")
STDOUT.reopen(log)
STDERR.reopen(log)
run Sinatra::Application
A quick touch tmp/restart.txt to restart Passenger, and there you have it! Sinatra and Dreamhost sitting in a tree..