Deploying Sinatra With Passenger on Dreamhost

If the following is true:

  • You want to deploy a Sinatra application with Passenger on Dreamhost
  • You’re using a Dreamhost shared hosting account
  • You’re application relies on gems that aren’t installed globally on Dreamhost
  • You’ve got the gems you need installed locally like this

Then you’ll want to include something like this in your rackup file:

ENV['GEM_HOME'] = '/home/<dreamhost user name>/.gems'
ENV['GEM_PATH'] = '$GEM_HOME:/usr/lib/ruby/gems/1.8'  
require 'rubygems'

This will make sure your locally installed gems will be available to your application. Maybe my google skills are getting rusty, but it took me a while to find this solution. Here’s the original source.