July, 2017
I have endured more needless misery and suffering with rails than with any other piece of software I have ever had anything to do with. Consider yourself warned. I intend to migrate completely away from it (and mostly have).
Ruby on Rails (aka "Rails") is a way to develop websites. I first came to rails after a couple of years of being an enthusiastic Ruby programmer. I also had just finished a significant web project using PHP and MySQL. During that project I realized that I was writing the same sort of code over and over and over. I immediately recognized how much rails could have done for me. Given how much I enjoy ruby, I was thrilled at the prospect of doing web development using ruby.
Ultimately though, rails has been a total train wreck, a bitter disappointment, and a source of misery.
Consider yourself warned.
If you are heading down this road, you might also take a look at Sinatra, which is a more lightweight approach to developing websites using ruby. Also, you should keep your eyes on Nodejs(from Google) which is event-driven server-side javascript, now being used to develop dynamic websites.
You also should consider two books. One is the Agile Web Development with Rails book. This should be "the book", but it is not as good as it should be, and does not seem to be getting better. The other is The Rails Way, which I am finding I like better the more I dig into it.
My experience with rails has not worked out as nicely as I might have liked or hoped. I have been badly bitten several times by rails projects, and would have been miserable if I had based an important production project on rails. The usual scenario is that when I update the machine that runs my webserver, a new rails update gets installed and breaks rails for me when I least want or expect it. In a nutshell: the rails deployment infrastructure is brittle. Here is the latest example (December 21, 2012).
Another angle on it is that I don't do rails full time. I don't live and breathe rails. I don't spend all my spare time reading rails forums and blogs and I don't want to. My rails projects are just a few of the many things that I do. I get them going, then go off and do other things, then have to come back and fix them when some new wind blows through the rails world.
Here it is 2011, and I am going through another round of this insanity. First there was lighttpd and fastcgi, then it was apache and mongrel and mongrel clusters. Now rails 3 doesn't want to work with mongrel, and something called passenger is recommended. The word is that the rails team thinks unicorn is the answer .... for now. Also there is talk about using the nginx web server instead of apache ... groan! Some of these changes may be for the best, but they sure can be painful.
I now have several years of experience with rails and a couple of small rails based web projects behind me. My words of wisdom to the rails newcomer, given this background, are as follows. Carefully analyze your project and decide if rails is the best tool. As someone has said, rails has its "sweet spot", and if your project is in that zone, you may win big with rails. On the other hand, there is a substantial learning curve. Rails has been called "opinionated software", and if you don't go with the rails flow, it will fight you every step of the way.
I got a big laugh out of this quote in Michael Hartl's excellent rails tutorial. Somewhere in chapter 8, I read:
"much of the elegance of Rails ultimately derives from the malleability of the underlying Ruby language."
I don't want to rag on Mr. Hartl specificaly, but the irony of this in the midst of the rails philosophy of "opinionated software", "syntactic vinegar", and the overall philosophy of "Our way or the highway" is most assuredly not lost on me. It borders on crass hypocrisy. Above all, I believe that rails has limited itself by this vulgar point of view.
Last but not least, rails deployment is a big issue that gets swept under the rug in much of the rails hype. Setting up a web server to handle rails is a nasty and prickly business. Things look great when your project is running on port 3000 of localhost, but there are lots of ugly surprises waiting when you decide to go live.
Since rails is opinionated, I can be too; hence these pages. They are by and large, my own notes for myself, but if they are helpful to you, that is great!
To get the current documentation for whatever rails version
you are running, in some shell window type gem server
Then use this link: Ruby Gems Documentation
Online, you can use: Rails API
The book is really lacking, and while they are busy telling you how great rails is and how they know the only right way to do things, they drop the ball in a lot of ways. One thing it could use is a systematic API interface (use the web), like the pickaxe book has for ruby itself.
Since I got started with rails (back in 2005?), rails has become wildly popular, and there are lots of rails books now, the trick is sorting out those that are truly valuable from the duds.
Ruby on Rails notes / [email protected]