Sinatra on Dreamhost!

Posted in Uncategorized on Jun 22, 2008

Sinatra on Dreamhost

Hello, Finally you can host all those sinatra apps you have been building on Dreamhost. They have Phusion Passenger 2.0 RC 2 and it can run Rack based apps like Sinatra, Merb, Camping, etc.. I had to do some hacking to get this to work for some reason doing require ‘sinatra’ was not loading, so I had to do an absolute require and then it all worked great. I created something simple with Sinatra being hosted on Dreamhost. check it out! modrails.fernyb.net

9 Responses to “ Sinatra on Dreamhost! ”

  1. # 1 taelor Says:

    Did you use the supplied config.ru files from the passenger website?

    I tried to get this working with Merb a little while back, and had some problems, but I felt as if I was close. I too was having some require problems. Could you share any more specifices with me as to how you got this running?

  2. # 2 FernyB Says:

    @taelor, this is what I did,
    1. Install Ruby and RubyGems on my shared account.
    2. Install any gems I will be requiring.
    3. Set the ENV variables in the config.ru so when you do a require ‘rubygems’ or require ‘sinatra’ it can find YOUR installed gems.

    If you want to see the code that I use for config.ru I have pasted it on pastie.
    http://pastie.org/228319

    For installing Ruby and RubyGems I followed this article:
    http://nateclark.com/articles/2006/10/20/dreamhost-your-own-packages-and-gems
    except you need to download the gems and install them locally by using
    “gem install -l gemame.gem”

    let me know if this helps.

  3. # 3 taelor Says:

    still no luck, i emailed you back with more explinations.

  4. # 4 fernyb Says:

    @Taelor, I have merb installed check it out -> http://modrails.fernyb.net

  5. # 5 Micah Says:

    fernyb,
    there is now an error with passenger:

    “no such file to load — merb-core”

    hope you figure it out because I’m interested in trying sinatra and merb on my DH account!

    Micah

  6. # 6 DennisBB Says:

    Did you know guys that you can do (nc joyent.com 80 GET / HTTP/1.1) on joyent servers and they have a cool message in http headers. like

    Served-By: Joyent
    With: SecretSauce

  7. # 7 Shawn Says:

    I see it can’t find merb-core. Does it work if you freeze Merb into your app? I’m considering getting a DH accout for a Merb app and would love to see this working.

  8. # 8 FernyB Says:

    @Shawn, it works. Sometimes it will say merb-core not found but if you refresh, it will be all fine. That is the only weird issue…

    The way I solved this issue for myself at least, was by using a cronjob that will just curl my site every 45 minutes because I think it is 60 minutes it will restart when there is no activity otherwise it just stays up.

  9. # 9 Shawn Says:

    That’s great. Thanks!

  • Recent Comments