Typography is the craft of endowing human language with a durable visual form, and thus with an independent existence. (...) Typography remains a source of true delight, true knowledge, true surprise.

Robert Bringhurst, The Elements of Typographic Style

By Steffen, on April 19, 2009

Ruby Programming

Tags: ,


In this nice blog entry is some description of how to make rails work with passenger on site5. As I liked to have Sinatra working for myself (and had the sinatra and rack gems installed locally), here is how it works for me:

  • As usual with rails apps, have a symlink point from within $HOME/public_html to the public folder of your sinatra app.
  • Create a .htaccess file in the same public directory, looking like

    PassengerEnabled on
    RackBaseURI /linkname
    

    which certainly means that you have to put in the name of the symlink

  • Create a config.ru file in the app root

    ENV['GEM_PATH'] = "#{ENV['HOME']}/gems:/usr/lib/ruby/gems/1.8"
    ENV['GEM_HOME'] = "#{ENV['HOME']}/gems"
    
    require 'rubygems'
    require 'sinatra'
    
    set :env,  :production
    disable :run
    
    require 'app'
    

    The only significant change to a plain config.ru is the addition of the GEM_PATH at the very top of the file – this way your locally installed gems are being picked up by passenger

One more thing: it turned out to be a good idea to include the ENV['GEM_PATH'] = “#{ENV['HOME']}/gems:/usr/lib/ruby/gems/1.8″ line on top of the rails application file as well. Without that, starting a fresh passenger fork will cause an exception – it will however work on the second attempt. Will have to look into this …



2 Comments to “Sinatra meets Passenger at Site5”

  1. [...] to install a simple Sinatra app on Site5. I didn’t find a lot of documentation, but a post gave some hints in the right [...]

  2. BOBBY says:


    Medicamentspot.com. Canadian Health&Care.Special Internet Prices.No prescription online pharmacy.Best quality drugs. High quality pills. Order drugs online

    Buy:Advair.Benicar.Female Pink Viagra.Seroquel.Zetia.Wellbutrin SR.Ventolin.Amoxicillin.Cozaar.Female Cialis.Prozac.Buspar.Acomplia.Zocor.Lipitor.SleepWell.Aricept.Lasix.Lipothin.Nymphomax….

Leave a Reply

You must be logged in to post a comment.