> Ok I tried sinatra. It seems like it fires up webrick on port 4567, so I 
> take it there's some config file I need to mess with, or my hosting 
> provider deals with so it'll run on Apache instead?

If you have a Rails hosting provider, they can probably host Sinatra 
too. Both just run on top of Rack.

If your hosting provider uses Phusion Passenger (= mod_rails), that can 
host Sinatra.
http://www.modrails.com/documentation/Users%20guide%20Apache.html#_sinatra

If you have a totally generic hosting provider then you may be stuck 
running your app as a cgi-bin or fastcgi (although obviously they'll 
still have to provide you with a ruby interpreter). That may be enough 
to get you started, but you'd probably be best changing to a different 
hosting provider longer term.

I've run small fastcgi apps successfully; experience from many Rails 
users has been that it has a tendency to explode. As a result, most ruby 
people (and developers) are staying away from fastcgi. But it still 
*should* be possible to build rack to work under fastcgi; see the README 
in the rack gem. You'll need the ruby fcgi gem, which in turn depends on 
the C fcgi library.

> Also, I can hit my sinatra ruby script from my browser, but when I tried 
> to hit it from a jQuery AJAX request, I get nothing back and the sinatra 
> console says that it was an OPTIONS request instead of the GET request 

No idea on that. It all works for me. Use tcpdump to prove or disprove 
that jQuery is sending an OPTIONS request; that would show if it's a 
problem with your jQuery code.

> So I can just use the Sinatra lib to route the request, deal with 
> cookies and sessions, and then hand it to my hosting provider and 
> they'll set it up properly?

Depends on how clued up and helpful your hosting provider is :-)

> if one person
> requested it, it started running, hitting the db etc, and then another 
> person requested it before it was finished, what happens?

Sinatra has a request lock turned on by default, so that the second 
request will wait until the first completes, but you can turn it off if 
you are sure your application is thread-safe.

However, running under fastcgi or mod_rails, only one request would be 
sent at a time to your application. Therefore you will need to spawn 
multiple processes to handle concurrent requests. This should be done 
for you, but you may wish to tune the parameters for min/max processes 
spawned.
-- 
Posted via http://www.ruby-forum.com/.