Buy me a Coffee


Ruby on Arch Linux

1 min read

Ruby is a dynamic, open source general-purpose programming language with a simple and easy to understand syntax. Writing code in Ruby is very easy, Ruby based source code is easy to read to a non-programmer to. Ruby is widely used for creating web applications and offers really popular web frameworks like Sinatra, Ruby on Rails and many others, Ruby is also used to create command line tools, It can also be used for writing awesome desktop applications.

Ruby packages are called “gems“, these gems can be installed using Rubygems the package manager for Ruby.

Installing

Ruby can be installed using a simple command.

``` sudo pacman -S ruby ```
Exporting Ruby and gem binary path. You need to add these lines to your ‘.bashrc’ or .’bash_profile’, If you are using ZSH, you need to add this in your ‘.zshrc’, if you are using ‘grml-zsh-config’ from the Arch Linux repository you need to add this in ‘zshrc.pre’
``` PATH="$(ruby -e 'puts Gem.user_dir')/bin:$PATH" export PATH ```
You can reopen your Terminal and Ruby and gem should now be executable or.
``` /bin/bash --logout ```
You can update Rubygems to the latest stable version. At the time of writing this post Rubygems installed by default is ‘2.2.2’. You can upgrade it to ‘2.3.0’ by entering this command below.
``` gem update --system ```
Checking the version of Ruby your are running.
``` ruby --version ```
You can do the same to check the version of Rubygems installed.
``` gem --version ```
Now we have Ruby installed on our system. If you have any problem feel free to leave a comment below.