Sinatra

From DreamHost
Jump to: navigation, search
The instructions provided in this article or section are considered advanced.

You are expected to be knowledgeable in the UNIX shell.
Support for these instructions is not available from DreamHost tech support.
Server changes may cause this to break. Be prepared to troubleshoot this yourself if this happens.
We seriously aren't kidding about this.

Sinatra [1] is a DSL for quickly creating web-applications in Ruby with minimal effort

Since DH supports Passenger, which in turn supports Rack-based ruby applications, you should be able to run Sinatra with no issues.

The Sinatra Book had an excellent section on how to deploy your Sinatra application to Dreamhost, which is in the sinatra recipes repo now [2]

If you encounter this error after following the instructions in the book,

 can’t activate rack (>= 0.9.1, < 1.0, runtime), already activated rack-0.4.0

then add the following two lines to the beginning of your config.ru.

 require '/home/USERNAME/.gem/ruby/1.8/gems/rack-<VERSION-OF-RACK-GEM-YOU-HAVE-INSTALLELD>/lib/rack.rb'
 require '/home/USERNAME/.gem/ruby/1.8/gems/sinatra-<VERSION-OF-SINATRA-GEM-YOU-HAVE-INSTALLELD>/lib/sinatra.rb'