Blue Flavor

Bonsai Trees VII by Garrett Murray

Getting Started with Rails

January 8th, 2008 at 9:11 a.m.

With the recent release of Rails 2.0, now is a great time to join the community and learn the framework. I’m frequently asked the following question, or some iteration thereof: “How do I get started with Ruby on Rails?” My answer varies depending on a person’s past development experience, but there are a few simple ways to start down the road toward a happy Rails future.

For the literate, there are books

Different people have different learning styles. For some, books just won’t cut it, but I’m inclined in this case to insist a beginner start, well, at the beginning. Books will do that for you. While websites, tutorials and chat (we’ll cover this later) will help out quite a lot, a good book gives one a solid foundation on which to look for further knowledge.

Since I began developing with Rails, I have always recommended the same book for beginners: Agile Web Development with Rails. Written by Dave Thomas and David “DHH” Heinemeier Hansson (and other talented folks), this is the best way to start. You’ll learn Rails and Ruby basics, and by the time you’re done you’ll have a solid grasp on the concepts and be able to write an application from start to finish.

Once you work your way through Agile Web Development, I recommend picking up David A. Black’s Ruby for Rails, which will give you a better understanding of Ruby, the language which powers Rails, in a Rails-application context. In the long run, your Ruby skills will become more and more valuable as a Rails developer, as they will allow you to extend the framework, make customizations and so forth. Luckily for you, Ruby is a fantastic language which is easy (and fun!) to learn.

And, of course, I’d be remiss if I didn’t mention Programming Ruby: The Pragmatic Programmers’ Guide, by Dave Thomas (Thomas sure writes a lot of books, eh?), Chad Fowler and Andy Hunt. Programming Ruby will help you get deep into Ruby and learn more about the core language, standard library, coding practices and more. It is a bit dense for a beginner, but you’ll find it valuable as you get more and more experienced.

Beyond book learnin’, or: Get to it

Once you’ve read a few chapters and started playing with Rails, the best course of action is to create an application. One of the best learning applications is a simple content management system—say, a weblog engine. A weblog CMS requires authentication, a few controllers and models, some templates and should give you a solid set of goals to accomplish. The best way to learn is to do.

It’s also important to get used to reading the Rails documentation, since it’s the first place you’ll look when you can’t remember how something works. In addition, the Rails wiki contains loads of useful knowledge, links and advice (and, in some cases, makes up for errors that may exist in the documentation).

Additional help

I recommend subscribing to some of the more popular Rails weblogs: Mike Clark, Nuby on Rails, Quoted-Printable and the { buckblogs :here } are a good start. You might not understand all the posts at first, but over time you’ll start to get it. These guys are all much smarter than me so it’s good to see what they’re up to or suggesting.

Better yet, should to subscribe to and watch Ryan Bates’ Railscasts. Ryan does an excellent job showing you how to use various Rails features and techniques to your advantage, and they’re great for everyone from novice on up. Even better—they’re free. I have my subscription syncing over to my Apple TV and once a week I watch another excellent tutorial.

If you’re the type, you should also stop by the IRC channel #rubyonrails on irc.freenode.net. Usually packed but frequently helpful, you’ll be able to converse with other Rails users and help each other solve problems. I’ve learned many things from hanging out in that channel, especially in the beginning.

Garrett Murray

More Information