Getting up & running with Sinatra (0.9.1.1) on Dreamhost

rack ruby sinatra webapp dreamhost passenger

Mon Apr 13 08:26:07 -0700 2009

Since passenger has rack support and since dreamhost supports passenger, I went with a forked scanty blogging app as my du jour. Provided you activate Ruby on Rails Passenger (mod_rails) support on the domain managed by dreamhost, the following steps will hopefully cut your time in getting rack-based app up and running on dreamhost. It appears dreamhost seldom update the gems and sinatra is not available as a gem where scanty's hosted. Furthermore, their rack gem version is outdated @ 0.4.0 as of this writing. So, scanty uses sinatra (0.9.1.1) and rack (0.9.1) as vendored plugins. Below's my *config.ru* file to make scanty jive on dreamhost:
require 'vendor/rack/rack'
require 'vendor/sinatra/sinatra'
require 'rubygems'

disable :run
set :environment, ENV['RACK_ENV'].to_sym
set :raise_errors, true
set :views, File.dirname(__FILE__) + '/views'
set :public, File.dirname(__FILE__) + '/public'
set :app_file, __FILE__

require 'main'
run Sinatra::Application
And presto, up and live this blog went! Caveat: Make sure rack, then sinatra are loaded first before you load rubygems. That way you're not relying on dreamhost to muck things up for you.
blog comments powered by Disqus