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.
Free · No login · Terminal · Beginner

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 →

Tips and discussion
No tips yet.
Sign in to share a tip.