Ruby on Rails Books

This page is devoted to the best Ruby on Rails books for the reader who wishes to learn how to program in Ruby on Rails (the framework). You can also check out my page on the best Ruby books to learn about resources for Ruby (the language) on its own.

If you don’t have a Ruby foundation you may want to grab a book off the Ruby page, since approaching Rails without Ruby skills is not a wise idea. Rails is a web framework that’s written in Ruby for writing web applications in Ruby. Without knowing the language it’s hard to get the most out of the framework. If you can, at least consider reading both a Ruby and a Rails book at the same time (if you’re in a rush to learn Rails).

Over the past decade, Rails attracted a huge deal of attention among developers and with it came plenty of new titles on Amazon’s virtual shelf. Having programmed with Ruby on Rails since December 2004, I have read quite a few Rails books over the years (and even wrote one of my own at some point). Here I recommend what I consider to be the best Rails books out there today.

A word about Rails versions

Ruby on Rails 6 was recently released. While a lot of great Ruby on Rails books out there target Rails 2, 3, 4, and 5, do not make the mistake of buying an obsolete Rails book if you intend to develop with version 6.x of the framework.

Substantial changes were introduced in each major version of the framework, starting with a serious rewrite in Rails 3, so learning with obsolete material will be an exercise in frustration. Trust me on this.

Rails 5 books may still be worthwhile, so on this page, I’ve included a couple of them. Of course, when possible, favor Rails 6 books so that you can learn Rails through up to date books.

If you are looking for a Ruby on Rails video course, instead of a book, scroll down to the bottom of the page where I include what I consider to be the best Ruby on Rails course ever created.

Recommended Ruby on Rails books ordered by difficulty level

The Ruby on Rails Tutorial is one of the clearest, nicest introduction to Rails ever written. It assumes that you have zero knowledge of Rails, however, it is still a great read for those who have some experience under their belt.

Proceeding step-by-step, the Rails Tutorial will progressively give you more confidence as it teaches you best practices in the process of building a fairly complex Rails application.

What I like about the Rails tutorial is that it doesn’t stop at teaching you Rails 6, but it actually delves into the tools that are typical of the Rails ecosystem (such as Git or deployment on Heroku). I’ve read plenty of Rails books and trust me when I tell you that you want this one to help you go from zero Rails knowledge to building your apps in Rails in a month.

Technically, this is a self-published Rails book but Addison-Wesley publishes a printed edition. The book is also available online for free (legally), but that’s the HTML version only. For ebooks (in PDF, ePub and Mobi formats) you’ll need to buy a copy. The book also comes with a series of optional screencasts, which are not cheap but worthwhile since they give you the feeling of watching a Rails pro in action.

It’s worth noting that the author, Michael Hartl, has launched a subscription service called the Learn Enough Society, which includes this Rails book, as well as other programming resources. A good option for a beginner programmer.

This is the latest edition of the classic Agile Web Development with Rails book. The first Rails book to appear on the scene. It’s an excellent tutorial for intermediate and experienced developers, particularly if you like Agile methodologies and would like to gain a deeper understanding of the framework.

Most Rails programmers have leveraged this award-winning book to learn the framework at a time when, unlike today, Rails documentation was hard to come by. It’s a broad, far-reaching tutorial that has been evolved over the years to reflect changes in the framework and the industry, always promoting best practices in the process.

Those of you who already have a basic understanding of how Rails works – which you may have acquired by reading tutorials, writing some sample apps, or studying one of the books listed above – might want to bring their knowledge of the subject up to a pro level by reading Obie Fernandez’s “The Rails 5 Way”.

Obie is one of the top Rails programmers in the world, as well as an excellent teacher who placed a wealth of information in this great Rails book (now in its fourth edition) so that advanced programmers could get the most out of the Rails framework.

It’s an excellent, extensive reference that will be particularly useful to developers who are already confident about their Rails skills. A must-have for any serious Rails developer. Yes, it’s Rails 5 not 6, but it’s still a good resource until a fifth edition comes out.

As you become more experienced as a Rails developer, you’ll start to realize the importance of testing your code base, so that you can change it and improve it over time with some degree of confidence.

Spend enough time in the community, and you’ll hear all sort of random terms like RSpec, Cucumber, Capybara, and even factory_girl. These are all excellent tools to help you test your code base but navigating these waters can be tricky if you are new to Test-Driven Development (TDD).

Noel Rappin wrote the definitive guide on how to test Rails code and build much more robust projects as a result. I can’t recommend this Rails book highly enough to those who already are at least somewhat familiar with Rails already. Again, Rails 5 but the testing approach hasn’t really changed with the newer version, so most of the information is still very much relevant.

Regardless of how many Rails books you read, or your current skill-level, every Rails developer should read the official documentation at some point.

The Rails API documentation when you are facing a specific problem (e.g., the arguments of a helper) and the Rails guides to get a much better understanding of the various components that make up the framework.

Alternatively, if you are already a programmer, you might find Agile Web Development with Rails 6 a more apt starting point to get up to speed with the framework. Then still get the other two books.

This combo of three Rails books would already put your Rails theoretical knowledge ahead of that of many Rails programmers.

As far as the practice goes, it all comes down to spending time writing code and doing so on your own projects (but reading other people’s code is also important to grow as a programmer). This way you’ll be able to gain practical experience with Rails that is backed by a solid theoretical foundation.

Recommended Ruby on Rails course

I love taking online courses and over the years I have taken the majority of the often recommended Ruby on Rails courses. Which one is best? It’s all subjective, of course, but I and many other developers in the community have reached the conclusion that Ruby on Rails 6 by The Pragmatic Studio’s duo Mike and Nicole Clark is very hard to beat.

In this recently updated Rails course, you’ll learn everything you realistically need to know to get started building web applications with Ruby on Rails. The authors build a complete web application on video and then guide you to build a similar, but separate application in the exercise sections.

So you end up with two web applications, and in the process you’ll learn a lot about Rails and current best practices, including testing and deployment.