Skip to content
Breakpoint logobreakpoınt

Ruby Koans

Learn Ruby by making a chain of failing tests pass, one koan at a time

Ruby Koans teaches Ruby through tests. You download the koans, run them with rake, and the first failing test tells you what to fix. Some koans just need the right value filled in where a blank placeholder sits; others need you to write your own code. Each one builds on the last, and the run stops at the next thing you need to correct.

Play on rubykoans.com

Free · No login · Terminal · Beginner

Screenshot of Ruby Koans

About Ruby Koans

The koans are split by topic into files, such as hashes and modules, and cover the language's syntax, structure and common libraries. The authors also aim to teach a testing culture along the way. It suits programmers new to Ruby who like learning by fixing small, focused failures.

It is free with no account. You need Ruby and rake installed and work in your own terminal and editor.

On Breakpoint since 10 Nov 2026.

Questions about Ruby Koans

How do I run the koans and what do I edit?

In the koans folder you run ruby path_to_enlightenment.rb. The output names the first failing koan with its file and line. Open that file in any editor, such as Vim, Emacs, TextMate, RubyMine or VSCode, fix it and run again.

What does a double underscore in a koan mean?

A double underscore is a hint that you must supply your own code to make the test work. In other koans you only substitute the correct answer for an incorrect one, such as changing false to true.

Which Ruby version do I need?

The site tells you to check your install by typing ruby --version in a terminal. Any response with a version number greater than 1.8 is fine. If Ruby is missing, it points to the Ruby downloads page.

Made this game? Claim it →

Keyboard shortcuts

j / k
Move down / up the list (this page)
] / [
Next / previous page
o
Open the focused game
b
Save or unsave the focused game
/
Search (the home list, or the command palette elsewhere)
Ctrl K
Command palette: games, skills, pages (works even when single keys are off)
?
This help