Glossary · Programming

Ruby

Ruby is a dynamic, object-oriented scripting language known for expressive syntax and for powering the Ruby on Rails web framework.

Updated October 6, 2026

Ruby is a dynamic, object-oriented programming language created by Yukihiro "Matz" Matsumoto and released in 1995. In Ruby almost everything, including numbers and nil, is an object, and the syntax favors readable, concise code.

Why it matters

Ruby became popular largely through Ruby on Rails, a web framework that popularized convention over configuration and rapid development. It is used for web applications, scripting, build tools and developer tooling such as Homebrew and Jekyll. Its flexibility, including open classes and metaprogramming, lets libraries define expressive domain-specific languages, though it can make large codebases harder to analyze and Ruby is slower than compiled languages.

Example

words = %w[ping trace dig]
lengths = words.map { |w| w.length }
puts lengths.inspect   # [4, 5, 3]

map runs the block on each element and returns a new array. The block { |w| ... } is Ruby's closure syntax.

Common mistakes

  • Monkey-patching core classes in ways that surprise other libraries.
  • Triggering N+1 queries in Rails by looping over records without eager loading.
  • Forgetting that only nil and false are falsy, so 0 and empty strings count as true.

Get notified when this term updates

Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.

This page is general information written by our editorial team and updated when documentation changes. Servers and providers differ, so test changes safely first. See our editorial policy and disclaimer.