The official Ruby snap is available

Posted by Hiroshi SHIBATA on 8 Nov 2018

We released the official snap package of the Ruby language.

https://snapcraft.io/ruby

Snap is a package system developed by Canonical. It allows you to distribute a software with its dependencies for many different Linux systems. This solves the problem that a user cannot install the latest Ruby release from the default repository of their system like in rpm or apt.

On Ubuntu 16.04 or later, you can install the Ruby snap with the following command:

sudo snap install ruby --classic

(If you use other Linux distributions, please refer to https://docs.snapcraft.io/installing-snapd/6735.)

Our snap uses the “channel” feature to release multiple Ruby series concurrently. For example, without specifying a channel, currently Ruby 2.5.3 will be installed. But if you want to use Ruby 2.4, specify the 2.4 channel as follows:

sudo snap install ruby --classic --channel=2.4/stable

You can also use multiple channels. The following commands switch to Ruby 2.3:

sudo snap switch ruby --channel=2.3/stable
sudo snap refresh

Our snap sets the GEM_HOME and GEM_PATH environment variables to $HOME/.gem. So if you want to execute commands installed by gems, such as rails and rspec, without using bundle exec, you have to add the following line to your shell rc files (like .bashrc):

eval `ruby.env`

Since $HOME/.gem is shared by multiple versions, if you switch versions and use them, you will need to recompile C extensions using the gem pristine --extensions command.

The initial version of the official Ruby snap has been released during the Snapcraft summit held at the Canonical office in London on Nov 6-8th, 2018. Any feedback is welcome at https://github.com/ruby/snap.ruby.

Enjoy!

Recent News

Redesign our Site Identity

We are excited to announce a comprehensive redesign of our site. The design for this update was created by Taeko Akatsuka.

Posted by Hiroshi SHIBATA on 22 Dec 2025

Ruby 4.0.0 preview3 Released

We are pleased to announce the release of Ruby 4.0.0-preview3. Ruby 4.0 introduces Ruby::Box and “ZJIT”, and adds many improvements.

Posted by naruse on 18 Dec 2025

Ruby 4.0.0 preview2 Released

We are pleased to announce the release of Ruby 4.0.0-preview2. Ruby 4.0 updates its Unicode version to 17,0.0, and so on.

Posted by naruse on 17 Nov 2025

More News...