Book resources for learning Ruby on Rails

I've now been using Ruby on Rails for a little over a year and have found it to be a fantastic environment to build web based applications. The last year has not been without some serious pain and learning curves and while I hardly consider myself a master of the environment I've found a number of resources that may help you if you are considering using RoR as a development platform.

Sure, you can access nearly everything you need to learn RoR online but I am personally still addicted to the dead-tree model of learning. If you are like me and prefer buying books then read on. In the last year I've bought 10 books on various Ruby/Rails topics and what follows are the ones I've gotten the most use out of.

NOTE: Ruby on Rails is a constantly evolving environment and the information below is really relevant for early June 2009. Things can change in the Rails world relatively quickly. It's a good idea to stay up on Rails developments by following the Ruby on Rails blog at a minimum.

Learn Ruby First
Before you rush out to buy a Ruby on Rails specific book first you need to learn Ruby the programming language. If you've been writing applications in C/C++/C#/Pascal (like I had) then Ruby is a relatively easy language to learn. Since it is open source getting a copy of Ruby is usually just a matter of downloading it to your machine and running it. Mac users have a big advantage here because Ruby is bundled in with Leopard.

Though you can get up and running with Rails while having a very modest knowledge of Ruby I can't stress enough that you should take the time to understand Ruby before you dive into Rails. Why? Because building a basic application with Rails is so easy that you will be tempted (as I did) to just start building. If you haven't really learned the Ruby language you will take a lot for granted and not understand why things work the way they do. You will copy and paste code rather than write it and when you do write it you will likely not write it well.

The book nearly everyone talks about for learning Ruby is "the PickAxe book" by Dave Thomas: Programming Ruby. Dave Thomas has a great conversational writing style. He makes learning Ruby almost story like, walking you through code samples while providing deep coverage of the Ruby language. At 1000 pages (3rd edition) there is a lot of material here, including a reference for the core Ruby library.

If you want to become adept at using Rails you do not need to read the book cover to cover but should get through Part I before you start doing anything of significance.

Rarely do I count on a single text book to provide my knowledge of a subject and that's the case with Ruby. Based on a blog reader recommendation I also picked up The Ruby Way by Hal Fulton. Though it's nearly interchangeable with the PickAxe book, Hal Fulton has a very different writing style. Rather than weaving a story I've found The Ruby Way to be more reference like. While I started learning Ruby with the PickAxe book I find myself grabbing The Ruby Way more often now when I need to explore an area that I don't understand as well as I would like.

Both of these books are excellent resources for learning about the Ruby language and I recommend having them in your library.

Rails References
Once you have got a good grasp on the Ruby language you can dive into Rails. Once again I have two books that I turn to frequently. One is for learning/getting started, the other is a desktop reference.

While you can find lots of excellent quick tutorials for getting your first Rails application up and running quickly on the web (such as Sean Lynch's excellent tutorial for Rails 2.0) it can't match the depth of a book. Agile Web Development with Rails (AWDR) by Sam Ruby, Dave Thomas and David Heinemeier Hansson is a good way to walk through building your first Ruby on Rails application.

The authors use a step-by-step style to build up an online bookstore, providing side roads and discussion points along the way. Some of the core philosophies of Rails are mentioned here (like DRY), though they don't go into a lot of detail. I personally found that good; what I was looking for was a relatively light-weight book that takes me quickly through building an application so that I could see results. AWDR does that and starts to show off some of the cool things you can do in a Rails application.

If you are going to use Rails for anything other than playing around you need a good reference book that helps explain things in more detail than AWDR. By far my favorite Ruby on Rails book is The Rails Way by Obie Fernandez. This book is not by any stretch a book for helping you get started with Rails; instead The Rails Way covers how things really work inside of Rails. Want to understand what's really happening with a Controller? How routing works? How to really leverage ActiveRecord? Get this book.

Obie has created a great desktop reference that you can pick up and dive in at just about any point. You don't read The Rails Way cover to cover; you keep it handy and pop it open when you need to know more about something you're working on.

So there you have it, four great books on Ruby and Rails that will help you get started building applications in that environment. As I said at the beginning, Rails is a rapidly evolving environment and it's difficult for books to keep up.

Got a book for Ruby or Rails that you really like? A web site with excellent tutorials? Please drop a note in the comments and share.


Chris Bulow said…
Damn! Now you've got me tempted to learn this - and soooo little time :)
Anonymous said…
Best (free) Rails tutorials:

Best (free) Rails podcast:
David Alison said…
@Chris: Ruby (and especially Rails) is a great language/environment. I've been seriously impressed with how much I can actually get done with it and the fun I've had writing Ruby code. It takes some adjustment if you're coming from a structured language and a comprehensive development package (like Visual Studio) but once you do adjust the productivity gains are substantial.

@akmassey: Thanks - those are both excellent resources.
Unknown said…
I'm a Windows developer who has recently migrated to a Mac. I am now considering moving away from the Windows/.Net/ASP.Net/C# development environments for various reasons and I am in the process of looking at alternative tools/languages such as Ruby (& Rails), Python + frameworks, Java and GWT etc. I would be interested to hear if you went through a similar evaluation process and why you opted for Ruby on Rails.
David Alison said…
@Sharad: I did a blog post on that last year that may give you some insight.

As for the selection of RoR over Python, Java, etc. I really wanted to go with a framework that was simple, something I could grok pretty quickly. The reason I was tired of Visual Studio was the sheer complexity of the environment; when you have a development tool that can target anything from custom client applications and command line utilities on through web based services you have a huge amount of overlap.

Though Java has a huge following I didn't really give it too much thought. Most of the folks I knew that developed in Java didn't seem to care for it. For that reason more than anything else I didn't really consider it.

I did look very briefly at Python but didn't find that the frameworks (Django in particular) were as mature or comprehensive as RoR was. If I was going to switch to a new open source based language I wanted one that was in heavy use and had a vibrant and active community.

Keep in mind that my selection process was for an entrepreneur using this for my own business. If you are doing this to help build up your resume for either job growth or to obtain additional contracts your criteria would be very different than mine.
Anonymous said…
Have you read Why's Poignant Guide to Ruby? An excellent resource, though not everyone's style.
David Alison said…
@Anon: First I've heard of it. Any particular aspect of it that makes it worth recommending?

Popular posts from this blog

Keyboard vs. Mouse

Some cool Firefox add-ons

A hardcore Windows guy gets a Mac