What is Ruby and where it runs

Contents
What Ruby is
Where Ruby runs
Why learn Ruby
Matz is nice

What Ruby is

Ruby is a dynamic interpreted language created by Yukihiro Matsumoto, known as Matz. You write plain text, and the Ruby interpreter runs it line by line with no compile step in between.

Everything in Ruby is an object, even numbers and strings, so you can call methods on any value. The Ruby hub page holds the Russian edition of these notes.

puts "Hello from Ruby" # prints Hello from Ruby puts 2 + 2 # prints 4

Where Ruby runs

Ruby runs on Linux, macOS, and Windows, so one script can travel between machines with almost no changes. Developers use it for small automation scripts, command line tools, servers, and full web applications.

The interpreter itself can tell you which version is active through a built-in constant:

puts RUBY_VERSION # prints something like 3.2.2

Why learn Ruby

Ruby reads almost like plain English, which makes it a friendly first language. Short programs stay short, and the error messages usually point at the exact line that needs attention.

Ruby also teaches habits that transfer to other languages: objects, methods, blocks, and tests. Many teams still build products with Ruby on Rails, while others use plain Ruby for scripts and DevOps tasks.

Matz is nice

Matz designed Ruby for programmer happiness, and the community motto says it well: Matz is nice and so we are nice. Code should surprise you as little as possible and read from top to bottom with ease.

Here is a small taste of that readability. Even before you know the syntax, you can probably guess what happens next:

names = ["Ada", "Matz"] names.each do |name| puts name end

Next: Install Ruby and check the version

Article author: Arthur Isaev

Related articles
Ruby
Ruby course: zero to hero in 50 lessons
What is Ruby and where it runs
Install Ruby and check the version
irb: the interactive shell
Your first Ruby script
Variables
Numbers
Strings
Symbols
Truthiness: only false and nil
Conditions
Loops
Arrays
Hashes
Ranges
Methods
Blocks, procs, lambdas
String tools
Files and IO
Exceptions
Modules and mixins
Classes and objects
Inheritance
Enumerables
Duck typing and core idioms
Gems and Bundler
Testing with Minitest
Debugging
Encodings
Time and date
JSON and YAML
HTTP clients
Sockets
REST APIs
puts, print and p
Metaprogramming
Enumerators
Pattern matching
Arguments: splats and kwargs
Rake tasks
Environment and CLI
Logging
CSV
ERB templates
WEBrick server
Rails in one lesson
Capstone: todo CLI
Capstone: JSON API
Performance
Modern Ruby tour
Hero roadmap: the whole course on one page
Install Ruby on Windows 11
Install Ruby on Ubuntu
Install Ruby on Rocky Linux
Install Ruby on macOS
Install Ruby on FreeBSD
Ruby in Docker
Threads and fibers

Search this site

Channel @aofeed Chat @aofeedchat

Contacts and cooperation:
I recommend our hosting beget.com
Write to info@aredel.com if you:
1. Want to write an article for our site or translate an article into your native language.
2. Want to place thematically relevant ads on the site.
3. Ads on my site pass maximum censorship. If you see an ad block unsuitable for school-age children, shocking or misleading - please contact us by e-mail
4. Found a mistake, inaccuracy, bug, etc. on the site. ... .......
5. Articles can be shared on social media by clicking a network icon: