To deploy a rack app on Dreamhost, you have to do the follwoing (this example is deploying an app which is using the sinatra framework):


  1. Enable the mod_passenger for your domain (it has to point to public/)

  2. gem install sinatra

  3. create a yourdomain.com/config.ru like this
1
2
3
4
5
6
7
8
9
10
require 'rubygems'
require 'sinatra'
Sinatra::Application.default_options.merge!(
:views => '/path/to/your/views',
:run => false,
:env => :production
)

require 'main.rb'
run Sinatra.application

create a directory structure like this:
/mydomain.com
/mydomain.com/tmp
/mydomain.com/views
/mydomain.com/public
create a /mydomain.com/main.rb file like this:

1
2
3
4
5
6
require "rubygems"
require "sinatra"

get '/' do
"Hello World"
end

Comments