Ruby

Ruby

Ruby is an interpreted, high-level, general-purpose programming language which supports multiple programming paradigms. It was designed with an emphasis on programming productivity and simplicity. In Ruby, everything is an object, including primitive data types. It was developed in the mid-1990s by Yukihiro "Matz" Matsumoto in Japan.

Ruby is dynamically typed and uses garbage collection and just-in-time compilation. It supports multiple programming paradigms, including procedural, object-oriented, and functional programming. According to the creator, Ruby was influenced by Perl, Smalltalk, Eiffel, Ada, BASIC, Java, and Lisp.

See Ruby on Wikipedia.

Getting started

The Pro Linux Container of Brap is pre-configured with Ruby.

To see which version of Ruby is installed, run:

ruby -v

Here is a Hello, World! program file in Ruby, hello-world.rb:

puts "Hello, World!"

To run a Ruby program, run:

ruby hello-world.rb

Ruby in VS Code terminal

Screenshot: Ruby in VS Code terminal

Manage Ruby Versions

You may manage multiple Ruby versions using rbenv.

To see a list of available Ruby versions, run:

rbenv install -l

To install a Ruby version, run:

rbenv install 3.3.0

To set the default Ruby version, run:

rbenv global 3.3.0

To verify which version of Ruby is installed, run:

ruby -v

Keywords

  • ruby
  • high level
  • backend
  • frontend
  • fullstack
  • web

Back to top