How To Install Ruby On Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian And MacOS?

How To Install Ruby On Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian And MacOS?

ruby

Ruby programming language interpreter.

Maintainer: Antonio Terceiro



Section: ruby

Install ruby

  • Debian apt-get install ruby Click to copy
  • Ubuntu apt-get install ruby Click to copy
  • Alpine OS apk add ruby Click to copy
  • Arch Linux pacman -S ruby Click to copy
  • Kali Linux apt-get install ruby Click to copy
  • CentOS yum install ruby Click to copy
  • Fedora dnf install ruby Click to copy
  • Raspbian apt-get install ruby Click to copy
  • macOS brew install ruby Click to copy

Ruby programming language interpreter.

How to use ruby?

Below are few example commands for ruby that you can use in the terminal.

Open an Interactive Ruby Shell (REPL):
irbClick to copy
Execute a Ruby script:
ruby script.rbClick to copy
Execute a single Ruby command in the command line:
ruby -e commandClick to copy
Check for syntax errors on a given Ruby script:
ruby -c script.rbClick to copy
Show the version of Ruby you are using:
ruby -vClick to copy
To install the latest version of ruby in your favorite operating system just copy the ruby installation command from above and paste it into terminal. It will download and install the latest version of ruby 2024 package in your OS.