3

I have been learning Ruby and Sinatra over the past couple months and I would like to get my app out in the wild. I am looking for suggestions for web hosts that support Sinatra apps and any details as to the actual process would be great as well.

I currently use hostmonster for a couple other sites. Hostmonster does support Rails applications. I would assume since Rails runs on Rack, hostmonster will also run Sinatra apps but I am not certain.

I haven't had much luck finding documentation on running Sinatra apps on hostmonster or any other web host outside of Heroku. Also, I haven't been able to figure out how to get my Sinatra app running by following through the Rails installation documentation provided by hostmonster.

wuliwong
  • 4,238
  • 9
  • 41
  • 69

1 Answers1

1

You should be able to run on any app that works for Rack. The convention is to use the config.ru file. In there, instead of specifying how to load Rails, just specify how to load Sinatra.

Example config.ru

require File.dirname(__FILE__) + "/main"
run Sinatra::Application

Where "main" is the file that loads all the Sinatra stuff.

Joshua Cheek
  • 30,436
  • 16
  • 74
  • 83
  • That is actually how i have my Sinatra app setup. I uploaded it to the server but no dice so far. Anyway, it seems you agree with my assumption that Sinatra and Rails apps are both Rack apps and should both work on any server that advertises Rails support. Thats the whole point of Rack right? Maybe I'll post another question with the details of my app and hostmonster and see if anyone can help me troubleshoot it. Thanks. – wuliwong Jan 10 '12 at 15:39
  • True, but that doesn't mean they have Sinatra installed. Are you using Bundler? They surely support it, and that would allow you to install Sinatra. – bioneuralnet Jan 10 '12 at 16:42
  • I am using bundler, I didn't upload the Gemfile though. I'm trying that now. – wuliwong Jan 10 '12 at 18:31
  • Also, regarding the original answer, you said that the convention is to use the "rackup.ru" file. Then you give some details about the "config.ru" file. I'm assuming that you meant something like "the convention is the use the rackup file named 'config.ru'?" Or just dropping the ".ru" from "rackup.ru" would make that accurate too? If not please explain. :) – wuliwong Jan 10 '12 at 18:50
  • Yeah, it's config.ru, fixed the answer. – Joshua Cheek Jan 11 '12 at 02:29
  • I made a much more specific question about this matter here as I still am not getting this up and running. http://stackoverflow.com/questions/8809040/how-to-get-a-sinatra-app-to-run-on-hostmonster – wuliwong Jan 11 '12 at 23:16