Zen and the Art of Programming
Meditations on programming, startups, and technology

Ruby Books

This page is devoted to books for those who wish to learn how to program in Ruby. Click on the following link if you are looking for the best books on Rails. If you are looking into Ruby because of Rails, it is highly recommended that you get both a Ruby and a Rails book. If you are interested in pursuing the study of Rails as well, you can pick up the recommended reading material to help you do so from the Rails books page.


Ruby 1.8 or Ruby 1.9?

At this stage Ruby 1.8 is still the most used version of Ruby, but Ruby 1.9 is definitely the future and it’s quickly gaining widespread adoption. Ruby 1.9 brings a lot to the table in terms of improvements to the language and its overall performance. Fortunately learning 1.9 for those who already know 1.8 is a fairly quick and straightforward process. If you’re interested in Rails, Rails 3.x works with either version, so whichever one you want to learn first is really up to you. You could study 1.8 and then learn about the differences between it and 1.9 when the latter becomes more prominent in the Ruby community, or you could take a future-ready approach and start directly with 1.9 (ignoring 1.8 for the most part). As long as you learn one of these two versions, switching to a different version later on shouldn’t be an issue.

Recommended Ruby Tutorial/Reference books ordered by difficulty level

Title: Beginning Ruby: From Novice to Professional, Second Edition
Level: Beginner
Coverage: Ruby 1.8 & 1.9

spacer

This is the best introduction to Ruby for novice/beginner programmers. It lays down solid foundations for the language, while also nicely introducing the whole Ruby ecosystem. The author, Peter Cooper, is a well known figure in the Ruby community, and in this book he clearly demonstrates his ability to teach and communicate with newcomers. The second edition was released recently and includes information about Ruby 1.9, as well as lesser known web frameworks like Sinatra and Ramaze. This title is highly recommended for beginners.


Title: The Ruby Programming Language
Level: Intermediate
Coverage: Ruby 1.8 & 1.9

spacer

The Ruby Programming Language by David Flanagan and Yukihiro Matsumoto (matz) is, simply stated, the best book on Ruby available on the market today. It’s accurate, in-depth, and uses a reference style that doesn’t leave you with any doubts about the language. This book is co-authored by the inventor of Ruby (matz) and covers both Ruby 1.8 and 1.9. If you are an intermediate/experienced developer who is not afraid of understanding the subtleties of a new language, you can’t go wrong with this book.


Title: Programming Ruby 1.9: The Pragmatic Programmers’ Guide
Level: Intermediate
Coverage: Ruby 1.9

spacer

This is the third edition of the so-called “pickaxe”, the book most Rubyists have used to learn Ruby since 2000. This book acts as a tutorial and reference, and it’s aimed at professional developers, as it’s full of advanced concepts and theoretical explanations that go deeper into the ‘why’ and ‘how’ of Ruby and Agile programming. Not everyone’s cup of a tea, but definitely well worth it if you are already quite familiar with object oriented programming.


Title: The Ruby Way (2nd Edition)
Level: Intermediate
Coverage: Ruby 1.8

spacer

The Ruby Way (2nd Edition) looks like a cookbook, and within its pages you’ll find plenty of how-tos for several common tasks. It is therefore a valuable book if treated as a cookbook, but that’s not its main purpose. The Ruby Way is about learning how to deal with a variety of programming tasks in an idiomatic manner; it’s about taking your existing knowledge of Ruby and polishing it in order to apply it to both simple and complex scenarios. If it’s true that in Ruby there are usually several ways of accomplishing something (however to a lesser extent than Perl’s TIMTOWTDI principle), it’s also true that most developers will point out that there is often a best way of doing it. This book is about learning to code that “best way” in Ruby, the Ruby Way. This is the book from which David Heinemeier Hansson, creator of Rails, learned most of what he knows about meta-programming and Ruby. I personally consider The Ruby Way 2nd Edition to be a definite must-have, it’s chock-full of practical examples and advanced lessons.

Recommended Ruby Cookbooks

Title: Ruby Cookbook
Level: Beginner | Intermediate
Coverage: Ruby 1.8

spacer

The Ruby Cookbook is an invaluable tome that should have a sweet spot on your desktop. It provides more than 800 pages of idiomatic Ruby code recipes for common, highly interesting tasks. If you learn by doing, this book alone will be able to give you a great deal of insight into Ruby. Each recipe is throughly explained and will always be at hand, ready to help you out if you are stuck with a given problem. It’s not the type of book that you read cover to cover (unless you want to), but it’s a must have for Ruby programmers of all levels – and one that is bound to end up getting a lot use.


Title: Wicked Cool Ruby Scripts: Useful Scripts that Solve Difficult Problems
Level: Beginner | Intermediate
Coverage: Ruby 1.8

spacer

Wicked Cool Ruby Scripts is a short book that includes 58 scripts for solving several tasks ranging from system administration to web parsing to scraping, as well as more algorithmic examples and cryptography. The book is very accessible. Each script is carefully explained in a step-by-step manner that can be fully understood by beginners. The examples provided are fun and easy to grasp (more experienced programmers may find some of them a little on the basic side). Overall this is an enjoyable and recommendable cookbook that can be read cover to cover quite quickly.

Other must have Ruby books


Title: The Well-Grounded Rubyist
Level: Beginner/Intermediate
Coverage: Ruby 1.9

spacer

This is an incredible Ruby book. It’s aimed at the beginner/intermediate crowd, yet it manages to go into the deep inner workings of Ruby. The goal of this book is to refine the knowledge and style of those who have already some understanding of the language and would like to bring their know-how to the next level. Highly recommended.


Title: Design Patterns in Ruby
Level: Intermediate
Coverage: Ruby 1.8

spacer

This short (and sweet) book can be read in a matter of a few days, but it concentrates tons of advanced Ruby idioms, “best practices” and design patterns into one handy tile. Though design patterns vary from language to language, a few patterns that are required in Java become part of the built-in features of the Ruby language and its standard library, as this book demonstrates. Design Patterns: Elements of Reusable Object-Oriented Software (aka The Gang of Four book) is an awesome book, but you will find that quite a few design pattern implementations are quite specific to C++ and similar languages; overall this book is also quite advanced and might be difficult for the average programmer. The idea behind “Design Patterns in Ruby” is to create a modern, smaller, and more Ruby-specific introduction to design patterns. It’s an advanced text that explores all the fun stuff that Ruby provides programmers with, while still being accessible for those who are relatively new to the language. This is definitely not the best book for a complete and total beginner though. However this title is nothing short of amazing, and it should accommodate the needs of anyone with an ardent desire to learn the ins and outs of the power of Ruby’s expressiveness.


Title: Ruby Best Practices
Level: Intermediate
Coverage: Ruby 1.9

spacer

The authors do a perfect job of describing this book, so I’ll just quote them and add that this is an excellent second book on Ruby once you’ve studied one of the canonical tutorial books and gained some practice. “Ruby Best Practices aims to help Ruby developers from a wide range of skill levels improve their fundamental understanding of the language via exposure to the common practices and idioms that many seasoned Rubyists take for granted. With a strong emphasis on exploring real codebases, and an understanding that beautiful solutions depend heavily on context, this book lays out a clear road map to Ruby mastery for those who wish to pursue it.”

Other specialized Ruby books

The following titles are all great Ruby books that focus on specific topics. Click on their covers to see their description and learn more about them.

spacer spacer spacer spacer
spacer spacer spacer spacer

Go to the Recommended Ruby on Rails Books


The fine print (nah, just kidding…)

  • The links to Amazon contain my referrer id, so if you buy a book via these links, you also indirectly support this site (and for that I respect and thank you). It doesn’t cost you anything and it gives me a little boost to help recoup my hosting expenses and dedicate some of my spare time to this blog.
  • The books mentioned above are some of what I consider to be the best literature available today on the subjects at hand, based on my experience, those of my colleagues and possibly the opinions shared by most of the Ruby and Rails community members. There are plenty of good books published every month though, and if you’ve bought any of them or intend to buy one, you will probably be very satisfied nevertheless. That said, be aware that amongst the huge number of Ruby and Rails books being sold on the shelves at the moment, there are a few bad apples that I wouldn’t recommend at all. I won’t name such titles here (for now), but beware and read Amazon reviews if you decide not to stick to my recommendations.

  • Books are very helpful and you should definitely read them and keep a few on hand for reference. Remember though that in order to succeed at programming, there is no substitute for gaining experience by coding in practice. This means that along with a tutorial, you should also get “how to” style books and follow them by reproducing their code examples (and by applying the acquired skills to your own programs).
  • I was one of the contributors to the Ruby Cookbook, but my judgment of that particular book is in no way altered by this fact.

Updated: December 2010

Copyright © 2005-2012 Antonio Cangiano. All rights reserved.
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.