I've been searching for a little while now on how to use ruby for web development without using rails or another framework. I would like to use ruby for web development in basically the same way PHP is used. I was wondering if anyone here has set up something similar or knew anything about it. Is it even possible if you don't have access to the php.ini file on the web host? Also, do you have to use a ruby server such as mongrel or webrick to use ruby on the web or can it be run through Apache only?
Edit: I've tried google but everything seems to pull up rails
This post has been edited by Nakor: 18 July 2010 - 01:40 PM
I'm going to address your 2nd question first. Can you run Ruby "through Apache only"?
You can't run PHP through Apache only. You need mod_php. There is something very close to this called Passenger. http://www.modrails.com/
Now, do you have to use a framework? No. You do need something that is Rack compliant? Yes. http://rack.rubyforge.org/ Rack is a standard webserver => ruby interface. Rails uses it, Sinatra uses it, everything in Ruby uses it.
The easiest way to get the most minimal rack compliant script up and going is to use Sinatra. http://www.sinatrarb.com/. You could also build your script to just be a "rack middleware" and you wouldn't even need sinatra.
I highly recommend using Sinatra. You can easily throw a script up that is 10 lines of code, throw it under a Passenger enabled vhost on apache, and you have the closest thing to "PHP" you can get. It's _very_ easy to get started.
This post has been edited by The Neoracle: 18 July 2010 - 01:46 PM
What I meant when I said I wanted to use ruby the same as php was that I didn't want to have to use Rails and everything that comes with it just to create a 2 or 3 page website that makes minimal use of a database. Some good info to look into, thanks.