Ruby without rails

just wondering how easy it is to implement

Page 1 of 1

3 Replies - 5540 Views - Last Post: 18 July 2010 - 02:41 PM Rate Topic: -----

#1 Nakor  Icon User is offline

  • Professional Lurker
  • member icon

Reputation: 444
  • View blog
  • Posts: 1,492
  • Joined: 28-April 09

Ruby without rails

Posted 18 July 2010 - 01:39 PM

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


Is This A Good Question/Topic? 0
  • +

Replies To: Ruby without rails

#2 The Neoracle  Icon User is offline

  • Check, check, 1, 2.
  • member icon

Reputation: 21
  • View blog
  • Posts: 4,097
  • Joined: 30-March 01

Re: Ruby without rails

Posted 18 July 2010 - 01:46 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

Was This Post Helpful? 2
  • +
  • -

#3 MitkOK  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 32
  • View blog
  • Posts: 403
  • Joined: 09-August 07

Re: Ruby without rails

Posted 18 July 2010 - 01:46 PM

If you want to use minimalistic web framework, look at Sinatra and Ramaze.
You can also use Rack to build custom web framework.

I strongly recommend you not to pick PHP shity idioms back to Ruby.
If you want to create mess like PHP, look at http://ruby-doc.org/...y/html/web.html

There's Passenger a.k.a mod_rails which will help you to deploy any rack app to Apache or Nginx - http://www.modrails...._web_frameworks

This post has been edited by MitkOK: 18 July 2010 - 01:49 PM

Was This Post Helpful? 2
  • +
  • -

#4 Nakor  Icon User is offline

  • Professional Lurker
  • member icon

Reputation: 444
  • View blog
  • Posts: 1,492
  • Joined: 28-April 09

Re: Ruby without rails

Posted 18 July 2010 - 02:41 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.
Was This Post Helpful? -1
  • +
  • -

Page 1 of 1