Ruby (programming language)

Ruby
Paradigmmulti-paradigm: object-oriented, imperative, functional, reflective
Designed byYukihiro Matsumoto
DeveloperYukihiro Matsumoto, et al.
First appeared1995
Stable release4.0.9 Edit this on Wikidata / 23 October 2026; 27 days ago (23 October 2026)
Typing disciplineduck, dynamic
Scopelexical, sometimes dynamic
OSCross-platform
LicenseRuby License or BSD License
Filename extensions.rb, .rbw
Websitewww.ruby-lang.org
Major implementations
Ruby MRI, YARV, Rubinius, MagLev, JRuby, MacRuby, RubyMotion, HotRuby, IronRuby, mruby
Influenced by
Ada, C++, CLU, Dylan, Eiffel, Lisp, Perl, Python, Smalltalk
Influenced
D, Elixir, Falcon, Fancy, Groovy, Ioke, Mirah, Nu, Reia, Crystal

Ruby is the name of a programming language that was created in the mid-1990s by Yukihiro "Matz" Matsumoto in Japan. Like other programming languages, such as Python, its structure (the way it works) is very similar to the English language. It has these qualities:

Many programmers like it because the creator tried to make it easy and nice to use.

Ruby on Rails (RoR) is a web application framework that is implemented using the Ruby language.

Example

An example Hello World program in Ruby:

puts "Hello World!"

An example program in Ruby that asks for your name and then says it:

puts "What's your name?"
name = gets.chomp
puts "Ah hello there, #{name}"

A function in Ruby that joins the 2 strings (or arrays/integers) into one, removes all numbers from it, capitalizes the string and then repeats it 5 times:

def somefunction(arg1, arg2) # creates a function with 2 arguments. the args can be called anything
    arg = arg1 + arg2 # this joins them into 1 string
    arg = arg.tr("1234567890","") # this replaces all the numbers with a nothing. erases them essentially.
    arg = arg.capitalize # read that out loud
    5.times do # read that out loud too
        puts arg # prints it on a new line
    end
end
somefunction("h1e2l6lo7,"," W5o6r8l9d!3") # does the function

Output:

Hello, World!
Hello, World!
Hello, World!
Hello, World!
Hello, World!