In trying to get btw working remotely on Dreamhost it was driving me crazy failing without any diagnostics; so I’ve put together this smaller set of files and have gotten it working.
In case it’s not clear from the Sinatra book (it wasn’t to me), the file tree you require is like this:
my_app_directory - eg. /home/<USER>/sinatra/test /config.ru - the rackup file /my_app.rb - the app /public - has to be there for DH to configure Passenger, even if empty /tmp - has to be there for Passenger, even if empty /restart.txt - Passenger reloads code if the modify timestamp here is new
I’m putting this here instead of checking it into git because you need to edit the gem path for your home directory, and ~ won’t do.
## config.ru - rackup file for sinatra on passenger on dreamhost # Passenger doesn't pick up my own gems without this ENV['GEM_PATH'] = '/home/<USER>/.gems:/usr/lib/ruby/gems/1.8' require 'test' run Sinatra::Applicationalias tt=‘touch ~/sinatra/test/tmp/restart.txt’ alias access_tail=‘tail -f ~/logs/DOMAIN_HERE/http/access.log’ alias error_tail=‘tail -f ~/logs/DOMAIN_HERE/http/error.log’
- Installing gems on DH – they don’t have sinatra or markaby among others, and you may wish to update them all to your local .gems directory
- Gem command reference
- Dreamhost wiki on sinatra
- Sinatra at Github
- Sinatra book
- Sinatra API
- Haml API
- Git cheat sheet – not all git commands (eg. git init) are implemented on Dreamhost