How To Install Ruby On Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian And MacOS?
Maintainer: Antonio Terceiro
Email: [email protected] .
Website: https://www.ruby-lang.org/
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):irb
Click to copyExecute a Ruby script:ruby script.rb
Click to copyExecute a single Ruby command in the command line:ruby -e command
Click to copyCheck for syntax errors on a given Ruby script:ruby -c script.rb
Click to copyShow the version of Ruby you are using:ruby -v
Click 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 2023 package in your OS.