Ruby and Rails
From the Ruby language, regular expressions and one-liners to Rails, Active Record, APIs, testing with RSpec, deployment and the architecture of large applications, Ruby and Rails as told through the free samples of the Leanpub books about them.
Created from the free samples of 13 Leanpub books and the descriptions and tables of contents of 30 more, with every source cited.
Ruby is a dynamic, object-oriented programming language designed to be pleasant to read and write, and Ruby on Rails, usually called Rails, is the web framework written in it that made the language widely known. A short tutorial on this shelf gives the framework's own account of itself: everything in Rails is designed to make a developer's life easier by making assumptions about what a new application will need, so that less code accomplishes more.[4] Another book puts the attraction in three phrases, that the framework is optimised for the programmer's happiness, that everything rests on convention over configuration, and that the language is easy to read and write, and adds the usual reservation about speed.[5]
The convenience has a cost that the more experienced authors describe from the inside. One, hired again and again to restructure other people's applications, found the same troubles in every one of them, oversized models, deeply nested controllers and callbacks firing where nobody expected, and concluded that the framework gives a developer three places to put code and no guidance beyond them.[2] Another recalls that the early tutorials prized the speed of building over practices such as testing, which was left for a chapter near the end.[1] A good half of the shelf is accordingly about structure, tests and maintenance.
This article covers where to begin, the history, the Ruby language, Rails itself, the data layer, programming interfaces, the architecture of large applications, testing, and deployment and workflow. Its sources are the free samples of the Leanpub books listed at the end, with the descriptions and tables of contents of the books whose samples were not available, and every claim that rests on a source is cited to it.
Where to start
Readers new to programming can start with the language. Ruby Is For Fun (2022) is a course for absolute beginners whose stated assumption is that the reader wants to earn a living as a programmer and to reach that result quickly.[3] Learn Ruby Programming by Examples (2018) teaches by exercises and was written with software testers in mind, people who tell its author that programming is too hard for them.[6] Toy Robot (2024) is for those who have finished a first tutorial and want something to build, and takes for its subject an exercise commonly set in job interviews,[25] and Programming For Entrepreneurs (2018) for founders who would sooner build a product than hire someone to.[26]
For the framework, Learn Ruby on Rails: Book One (2016), among the best-selling books here, is the first of two volumes for newcomers and explains how the web works, what Rails is and the practices of professional work before any code.[18] Active Rails (2021) builds an application for tracking tickets from nothing, with tests written first throughout,[30] and Concise Rails 6 (2021) is a short tutorial for readers who have already done the framework's own introductory guide.[4]
Working developers have references and specialised books. The Rails 8 Way (2025) and its predecessor The Rails 7 Way (2023) are large references to the whole framework;[34][33] Everyday Rails Testing with RSpec, the best seller on the shelf, is for those who have an application and no tests;[1] Efficient Rails (2016) assumes daily use of the framework and offers ways of saving time;[11] and Growing Rails Applications in Practice (2016) and Trailblazer (2016) are for those whose application has grown past comfort.[39][2]
History
Ruby was released in Japan in 1995 and remained little known elsewhere until the middle of the next decade, when Rails appeared and showed a complete web application being built in minutes. The framework's conventions, a fixed layout of models, views and controllers, a library that maps database tables to objects, and migrations that record changes to the schema, were copied by frameworks in most other languages. Its fashion peaked around 2010; since then the language has grown faster and the framework has absorbed in turn programming interfaces, background jobs and ways of updating pages without much JavaScript.
The books place themselves along this line. Concise Rails 6 recounts that the framework was created in 2003 by a developer working on a project-management tool, released as open source the next year and published as version 1 in 2005.[4] The author of Everyday Rails Testing with RSpec, a web developer since 1995, came to it in 2005 after tiring of tangled code in another language, and found that complex applications took a fraction of the time they had taken without a framework, though it meant learning a new language, an actual architecture and a more object-oriented way of working.[1] The middle years are represented by the books on taming what had been built quickly, Trailblazer and Growing Rails Applications in Practice of 2016, and by API on Rails 6 (2021), which descends from an openly licensed book of 2014 on building interfaces with the framework.[2][39][15] The reference books advance with the framework's version numbers,[33][34] and the newest group on the shelf is of a different kind altogether: four guides, From Ruby to Golang first among them, that teach another language to developers who know Ruby.[12][22][23][24]
The Ruby language
The introductions sell the language on economy. Learn Ruby Programming by Examples holds that programming languages are like dialects, that learning to think in one matters more than its syntax, and that Ruby was chosen because it is concise and so leaves the learner free to think. Its author coaches testers, for whom writing automated tests is, the book says, a more creative and satisfying job than repeating checks by hand, and the fear to be overcome is only that programming is hard. The method, new ideas introduced gradually through exercises, was first tried in teaching the author's own twelve-year-old child.[6] Ruby Is For Fun first asks what kind of programmer the reader wants to be, since nobody can master every field at once, and recommends a language that is useful outside web programming as a preparation for it; one of its early lessons demonstrates, by asking numbers and strings what class they belong to, that everything in the language is an object. Knowing a field, it adds, means knowing a language's basics, a little theory and the tools round it, the operating system among them.[3] Meet Ruby is the English edition of a reference long maintained in another language and revised with each major release, running from the basic types through control structures to the language's more advanced constructs.[19]
Two books by one author treat the language as a tool for text. Understanding Ruby Regexp (2024), among the best sellers, teaches regular expressions, which it calls a small programming language for extracting and transforming text, one feature at a time and with exercises, since scripting and automation so often come down to pulling a piece out of some input or changing its format.[7] Ruby One-Liners Guide (2024) covers the use of Ruby from the command line for filtering, substitution and the processing of fields, noting the languages from which Ruby descends and the older command-line tools it can stand in for.[8] Fast Feedback Using Ruby is about small scripts and tasks that give a developer automatic feedback,[27] and Toy Robot works one well-known exercise from start to finish with a test for each step.[25]
Under every Ruby web framework lies a common interface between server and application. Build Your Own Sinatra (2019) has readers write applications against it directly and then build a small framework of their own,[28] and Ruby on Roda (2021) builds a programming interface with a lighter framework and separate libraries for routing and for the database.[29]
Rails
Rails follows the pattern of models, views and controllers, and its attraction, in the words of Soon to be Ruby on Rails --API programmer (2021), is that following its conventions gives an application production-ready standards, including security, without their having to be chosen one by one. The same book concedes that the framework's speed is what its critics bring up, judges it good enough for most applications, and thinks the conventions worth learning even for use elsewhere.[5] Concise Rails 6 builds a site of questions and answers, with authentication, in a few chapters, and reassures the reader that the framework has been proven in use by a number of large and well-known services.[4] Active Rails is the long treatment, adding styling, authentication and access control to its application feature by feature, in an edition for the framework's sixth version of a book that has had several.[30] Build A SaaS App in Ruby on Rails 8 (2024) builds a subscription product step by step, from the choice of libraries through the management of users to payments and background jobs,[31] and Ruby Web Dev: The Other Way (2016) is one developer's short list of what a Ruby web developer ought to know.[32]
The references are The Rails 7 Way, a book of some 750 pages that covers configuration, routing, controllers, the data layer, views, security, caching and testing,[33] its successor for the next version,[34] and narrower guides: XML The Rails Way (2017) on producing and consuming one data format,[35] and The Ruby On Rails Interview Bible 2023 (2023), more than five hundred interview questions with answers.[36]
The data layer
The library that maps tables to objects is where much of a Rails application's behaviour is decided, and two books go into it for readers who know the basics. The sample chapter of Advanced Active Record (2018) is on scopes, the named, reusable pieces of a query. Its first example is a scope written with a fragment of raw SQL, which works alone and fails with an ambiguous column as soon as it is combined with a query across a second table; the fault, the book says, is the developer's, for handing the library a string to transplant, and the remedy is the library's own object model for queries.[9] Rails Way: ActiveRecord Deep Dive (2025) is a reference to advanced use for the framework's current version, separated from the larger reference to the framework and not meant as a first introduction.[37]
Programming interfaces
Rails applications increasingly serve data to other programs instead of pages to browsers, and six books cover that use. API on Rails 6 and the earlier API on Rails 5 build the interface of a marketplace, with users, products and orders, versioning and authentication by token.[15][17] Soon to be Ruby on Rails --API programmer is written for developers who want only a back end for a front end built with something else.[5] JSON API By Example (2016) is a short book that follows a published specification for such interfaces through one demonstration application,[38] REST API Documentation for Rails (2023) shows how tests can generate an interface's documentation,[20] and GraphQL for Rails Developers (2023), still in progress, adds the query language that lets a client ask for exactly the fields it wants, with opening sections on what it is, why to use it and when, and builds an application for browsing code repositories.[14]
Architecture of large applications
The argument of Trailblazer is that Rails needs more layers of abstraction. Its author describes the result of the framework's single-piece design as it appeared in project after project: views and helpers without structure, fragments of pages loaded with conditions so that they can be reused, tests that verify that mock objects have been mocked, a change to a mailer that breaks a model elsewhere. Skilled developers avoid this, the book allows, but many are not yet able to judge their own designs, and giving them structure is the whole point of a framework; the question most often heard is where a given piece of logic should go. The answer offered is a layer above Rails, adoptable step by step and leaving a team free to keep as much of the framework's usual way as it likes, that moves business logic out of models and controllers into objects made for the purpose.[2] Building your own authentication library with Trailblazer (2021) teaches the central one of those objects by building an authentication library.[16]
Other books keep to the framework's own means or change them less. Growing Rails Applications in Practice proposes structuring large applications with the tools a team already knows, by discipline and consistent conventions, and begins from the common experience that the framework seemed easy at the start and stopped seeming so as the application grew.[39] Gradual Modularization for Ruby and Rails (2025) divides an application into packages inside one codebase, with a tool published by a large commerce company, a more gradual route to modularity, it says, than the separate libraries and embedded applications that were long the only tools.[40] Maintainable Rails holds that the default layout, little changed in more than a decade, does not serve maintenance over the long term, and rebuilds an application on different libraries for data and validation.[41] An adjacent book carries the framework into a new field: Patterns of Application Development Using AI (2024) is a catalogue of patterns for building language models into an application, presented as a coherent approach and not a set of separate tricks, with its examples in Rails.[13]
Testing
Everyday Rails Testing with RSpec is addressed to developers who know they should test and do not, because tests seem to take time from features or because testing has always meant clicking through the browser. Its aim is a consistent strategy, tests that are reliable and meaningful enough that a developer can change code knowing the suite will report what breaks, and it builds one outward from tests of models, on a sample application, in a testing framework that it prefers without disparaging the one Rails includes. The author writes as a self-taught developer who worked alone for years on public projects with small budgets, the position, the book suggests, in which a testing habit is hardest to form.[1] A companion by the same author, Testing Rails from Scratch, covers every level of testing mostly with the tools that come with the framework.[42] The project books take testing as a method and not a topic: Active Rails writes tests before code throughout, and Toy Robot tests each step of its exercise.[30][25]
Deployment and workflow
Reliably Deploying Rails Applications (2021), in its fifth edition and still being revised, shows how to set up a rented server from nothing, automate the setting up of more, and deploy to them reliably. It is offered to two kinds of reader, those paying heavily for a managed hosting platform and those whose own deployment sometimes fails to restart or loads the wrong version of the code, and it says for whom it is not intended. The edition is published while in progress: the essential path, from a bare server to a deployed application, is complete, and the chapters that explain what happens behind the scenes are being brought up to date.[10] Full Stack for Ruby Framework (2018) and Backend Handbook (2019) are shorter collections on servers, databases and getting applications running, the second a set of installation notes for developers who move between several machines.[21][43]
Efficient Rails is about the developer's own day: more than a hundred short problems and solutions, to be read in any order, beginning with the terminal, version control and the framework's console. It describes itself as practical and free of abstract theory, each solution being something that can be learned and applied in a few minutes, and as filling the gap that opens once the introductory material has been used up.[11]
The four guides for leaving, or at least looking beyond, the language follow one method. From Ruby to Golang grew from notes made by a developer who took a job in another language in 2018 without having written a line of it, and found that relating each new construct to its Ruby counterpart, a structure where a class had been, an error returned where an exception had been raised, was the quickest way to learn and then to teach. Each answer to a question framed in Ruby's terms, the preface says, showed a little of how the other language thinks. From Ruby to Rust, From Ruby to TypeScript and From Ruby to Clojure apply the pattern to three more languages.[12][22][23][24]
Sources
Every source is a Leanpub book. The note after each says which part of it was read; where no sample was available, only the public description and table of contents were used.
- 1.Everyday Rails Testing with RSpec, Aaron Sumner: A practical approach to test-driven development Free sample: the preface and the introduction, on why to test and the author's approach. 2026. Free sample: PDF · EPUB
- 2.Trailblazer, Nick Sutterer: A New Architecture For Rails Free sample: the introduction, on the problems of large Rails applications and what the book proposes. 2016. Free sample: PDF · EPUB
- 3.Ruby Is For Fun, Roman Pushkin: Self-Study Course, From Absolute Beginner to Advanced Free sample: the introduction and excerpts from early lessons. 2022. Free sample: PDF · EPUB
- 4.Concise Rails 6, Blessed Sibanda: Build powerful and modern web applications with Ruby on Rails Free sample: the introduction, on what Rails is, and the setup. 2021. Free sample: PDF · EPUB
- 5.Soon to be Ruby on Rails --API programmer, SaKKo Sama: Building API could be fund with Ruby on Rails. Let Rails help you with easy and fast coding while you only need to worry about requirements and features. Free sample: the introduction and the first chapter on conventions and models. 2021. Free sample: PDF · EPUB
- 6.Learn Ruby Programming by Examples, Zhimin Zhan, Courtney Zhan Free sample: the preface, on why to learn programming and why Ruby, and the first exercises. 2018. Free sample: PDF · EPUB
- 7.Understanding Ruby Regexp, Sundeep Agarwal: Example based guide to mastering Ruby regular expressions Free sample: the preface and the opening chapters. 2024. Free sample: PDF · EPUB
- 8.Ruby One-Liners Guide, Sundeep Agarwal: Example based guide for text processing with Ruby from the command line. Free sample: the preface and the opening chapters. 2024. Free sample: PDF · EPUB
- 9.Advanced Active Record, Tom Copeland: A Collection of Practical Deep Dives into Active Record Topics Free sample: the chapter on scopes. 2018. Free sample: PDF · EPUB
- 10.Reliably Deploying Rails Applications, Ben Dixon: Hassle free provisioning, reliable deployment Free sample: the preface to the fifth edition and the statement of purpose. 2021. Free sample: PDF · EPUB
- 11.Efficient Rails, Andrew Allen: Workflow Upgrades for Crafting Rails Apps with Superhuman Speed Free sample: the introduction and the first solutions, on the console. 2016. Free sample: PDF · EPUB
- 12.From Ruby to Golang, Joel Bryan Juliano: A Ruby Programmer's Guide to Learning Go Free sample: the preface and the opening chapters. 2026. Free sample: PDF · EPUB
- 13.Patterns of Application Development Using AI, Obie Fernandez Free sample: the opening of the introduction; most front matter is withheld. A course of the same name covers the same ground. 2024. Free sample: PDF · EPUB
- 14.GraphQL for Rails Developers, Ryan Bigg: Build a GraphQL API for Your Rails App The free sample was consulted for its contents: from those and the description. 2023. Free sample: PDF
- 15.API on Rails 6, Alexandre Rousseau: Learn best practice to build an API using Ruby on Rails 6. The intention with this book it’s not only to teach you how to build an API with Rails. The purpose is also to teach you how to build scalable and maintainable API with Rails which means improve your current Rails knowledge. In this book you will learn to: - Use Git for version control - Building JSON responses - Test your end-points with unit and functional tests - Set up authentication with JSON Web Tokens (JWT) - Optimize and cache the API The free sample was consulted for its contents: from those and the description. 2021. Free sample: PDF
- 16.Building your own authentication library with Trailblazer, Nick Sutterer The free sample is mostly headings: from those and the description. 2021. Free sample: PDF · EPUB
- 17.API on Rails 5, Alexandre Rousseau: Learn best practice to build an API using Ruby on Rails 5. The intention with this book it’s not only to teach you how to build an API with Rails. The purpose is also to teach you how to build scalable and maintainable API with Rails which means improve your current Rails knowledge. In this book you will learn to: * Build JSON responses * Use Git for version controlling * Testing your endpoints * Optimize and cache the API The free sample was not used: from the description and table of contents. 2021. Free sample: PDF · EPUB
- 18.Learn Ruby on Rails: Book One, Daniel Kehoe The free sample is a table of contents only: from that and the description. 2016. Free sample: PDF
- 20.REST API Documentation for Rails, Blake Erickson: A complete guide on creating RESTful API Documentation for your Ruby on Rails application. The free sample was not used: from the description and table of contents. 2023. Free sample: PDF · EPUB
- 21.Full Stack for Ruby Framework, Fredy Konig: Guide for Ruby on Rails, Sinatra on Linux environment. The free sample was not used: from the description and table of contents. 2018. Free sample: PDF · EPUB
- 22.From Ruby to Rust, Joel Bryan Juliano: A Ruby Programmer's Guide to Learning Rust The free sample was not used: from the description and table of contents. 2026. Free sample: PDF · EPUB
- 23.From Ruby to TypeScript, Joel Bryan Juliano: A Ruby Programmer's Guide to Learning TypeScript The free sample was not used: from the description and table of contents. 2026. Free sample: PDF · EPUB
- 24.From Ruby to Clojure, Joel Bryan Juliano: A Ruby Programmer's Guide to Learning Clojure The free sample was not used: from the description and table of contents. 2026. Free sample: PDF · EPUB
- 25.
- 26.Programming For Entrepreneurs, Christopher Franklin: Learn Just Enough to Build Your Business No sample: from a short description. 2018.
- 27.Fast Feedback Using Ruby, Stephan Kämper No sample: from the description and table of contents. 2026.
- 28.
- 29.Ruby on Roda, Mateusz Urbański: REST APIs with Roda & Sequel No sample: from the description and table of contents. 2021.
- 30.Active Rails, Ryan Bigg, Kieran Andrews, Rebecca Le, Robin Klaus No sample: from the description and table of contents. 2021.
- 31.Build A SaaS App in Ruby on Rails 8, Rob Race No sample: from the description and table of contents. 2024.
- 32.Ruby Web Dev: The Other Way, Yevhen Kuzminov: Personal best practices guide No sample: from the description and table of contents. 2016.
- 33.The Rails 7 Way, Lucas Dohmen, Tom Henrik Aadland, Obie Fernandez No sample: from the description and table of contents. 2023.
- 34.The Rails 8 Way, Lucas Dohmen, Tom Henrik Aadland, Obie Fernandez No sample: from the description and table of contents. 2025.
- 35.
- 36.The Ruby On Rails Interview Bible 2023, Nezir Zahirovic: A Comprehensive Guide with 500+ Essential Questions and Answers! No sample: from the description and table of contents. 2023.
- 37.Rails Way: ActiveRecord Deep Dive, Lucas Dohmen, Tom Henrik Aadland, Obie Fernandez: Advanced Usage of ActiveRecord in Rails 8 Applications No sample: from the description and table of contents. 2025.
- 38.
- 39.Growing Rails Applications in Practice, Henning Koch, Thomas Eisenbarth: Structure large Ruby on Rails apps with the tools you already know and love No sample: from the description and table of contents. 2016.
- 40.Gradual Modularization for Ruby and Rails, Stephan Hagemann: Improve collaboration, system design, and flexibility No sample: from the description and table of contents. 2025.
- 41.
- 42.Testing Rails from Scratch, Aaron Sumner: A practical, (mostly) out-of-the-box approach to test-driven development in Ruby on Rails No sample: from the description and table of contents. 2026.
- 43.
Further reading
Other books and courses in the library on neighbouring ground, not cited above.
- From Ruby to Golang: The CourseCourse, Joel Bryan Juliano: Use what you already know in Ruby to write idiomatic, production-ready Go. The course version of the guide to Go for Ruby developers. 2026.
- From Ruby to Rust: The CourseCourse, Joel Bryan Juliano: Turn your Ruby instincts into safe, fast Rust: ownership, traits, lifetimes and more. The course version of the guide to Rust for Ruby developers. 2026.
- REST HOW TOs, A.P. Rajshekhar, Shrikant Khare: Consuming and Building REST API in Python, Ruby, Java, C# and Go Recipes for consuming and building web interfaces in five languages, Ruby among them. 2022.
- Write a compiler for brainfunk, Jean Lazarou A tokenizer, compiler, virtual machine and other tools for a tiny language, written in Ruby. 2020.
- The "minimul" QuickBooks Online API Guide, Christian Pelczarski: Volume I: Best Practices Guide for Connecting and Importing The first steps of integrating an application with an accounting service, with Ruby code. 2017.
- Learning to program: by example., Jean Lazarou An introduction to programming that builds a word game in fifteen steps, run as a real project would be. 2016.