Deploying Rack Apps (e.g. Sinatra) on Dreamhost
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):
- Enable the mod_passenger for your domain (it has to point to public/)
- gem install sinatra
- 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 |