Forum Moderators: coopster
A friend is trying to turn me on to Ruby on Rails, but when I looked around, it seems you need a special server to run this. My host server doesn't run Ruby and I'd have to change machines.
This same friend says there are PHP frameworks that work similarly. What PHP frameworks do you recommend? Also is there any benefits to Ruby frameworks over php?
Here are some related threads that may be of interest:
Scalability: Ruby on Rails vs PHP
[webmasterworld.com...]
Ruby On Rails
[webmasterworld.com...]
Ruby on Rails. Ajax
[webmasterworld.com...]
Any Luck with Ruby on Rails?
[webmasterworld.com...]
dc
The biggest hassle was getting Eclipse working on Fedora Core 5/64 so that I can run RDT and RadRails. (Optional but HIGHLY recommended! RDT is an IDE for Ruby. RadRails is an IDE for Rails, which requires RDT. Both run on the Eclipse IDE platform. All, ironically, are written in Java, and THAT is the hassle with FC5/64...)
I'm glad I hassled with the Eclipse installation, because RadRails is incredibly productive. It literally takes 10 minutes to write a simple database application with data-entry screen, field validation, list content. It certainly blows FreeRide (another Ruby IDE) out of the water, as well as working with a standard editor and command line. (Though in all fairness - without RadRails, I suppose this would take... 12 minutes.)
I'm using the 2nd Edition of "Agile Web Development with Rails" (currently available as a "beta book" in PDF form) and the just-release (yesterday) Rails 1.2 RC1. (The book was witten for Rails 1.2.) The first 200 pages of the book go through development of a catalog sales site with shopping cart, etc. with basically no background material - and, amazingly none is needed. I highly recommend going through the exercise of following the development of the sample app, as it really nails-down the Rails development philosophy.
Although the book doesn't use or I think even mention RadRails, it's very easy to switch from the console environment of the book to RadRails, as RadRails is pretty intuitively obvious.
Yes, it uses a special server, which will be a problem on some shared hosts, but should be dead-simple to install on a dedicated machine or VPS.
"Special server" is a bit of a misnomer. Ruby has a built-in webserver module. There are also a couple of better, add-on webserver modules, available as gems (gem is the Ruby package manager). The most popular is called "mongrel", and one typically runs a "pack of mongrels". (A handful of mongrel processes.) These don't need to run as root (and, indeed, you shouldn't) so if you can run programs in background, and have Ruby (which can be installed in your account, if you have shell access and it isn't on the system) you can run Rails.
The reason for this is that CGI isn't practical for Ruby (or for practically anything significant), Fast-CGI is problematical, and though there is a mod_ruby, it hasn't been widely adopted or supported by the Ruby community (no support in Rails).
You put a proxy in front of it using Apache or other general-purpose webservers or proxies. (More typically a load-balancing proxy module that hands-off to multiple instances of mongrel.) Similar to the approach taken for most Java server-side applications.
All the little oddities are suprisingly hassle-free. They LOOK like a big problem at first, but turn out to be nothing. It is MUCH easier to install Ruby/Gems/Rails than to install Perl from scratch, for example.
As far as the Ruby language itself goes, you will be most happy if your background is in C++ and Perl. I find it has everything that I like from each, and little that I don't like.
Some big reasons I choose RoR over any php framwork:
1. Ruby is elegant and easy to read.
2. The community. The api's, wiki, and discussion forum are awesome. You find what you need.
3. Convention over configuration. All you have to do is name stuff right, and work is automatically done for you.
4. It just works. Everything you need is at your finger tips. Little functions like pluralize and camelize are built right in, so you can just use them. No worrying about finding and installing libraries.
There's a learning curve. It's a "new" kind of framework that requires a new kind of thinking. It's imporatant to follow conventions. At first, you'll need to be patient, and maybe get the help of one of the books out there.
Also, deployment is a pain. The way I see it though, I spend most of my time in development. So it's important that I enjoy that time, and that I'm productive during that time. The sacrafice is worth it to me.
I messed around with Cake briefly and it didn't grab me, but Code Igniter is really elegant, small and well documented.
I've tinkered briefly with RoR and was highly impressed but the number of ruby jobs in Australia is miniscule compared to php so haven't had much of an oppurtunity to develop anything seriously.