Install latest version of Ruby and Rails using Snap

gugacavalieri

Guga Cavalieri

Posted on May 22, 2020

Install latest version of Ruby and Rails using Snap

I just started working with a new stack today and it involves a lot of techs that I have never worked with (Ruby, Rails).

I was having a hard time to create a new project with Rails 6.x mostly because the Ruby installed in my Ubuntu via apt-get was pointing to version 2.4.5.

I needed something newer ... And snapd was there to rescue me.

By running:

gustavo@bulls:~$ snap install ruby

and

gustavo@bulls:~$ ruby -v
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]

I finally got the newest version of Ruby and could finally do:

gustavo@bulls:~$ gem install rails
...
gustavo@bulls:~$ rails -v
Rails 6.0.3.1

Thank you snap. Well, here are some advantages of using ruby with snap:

  • Keep ruby and rail in a separate sandbox preserving your OS packages.
  • You can always get the latest version even if your OS do not provide them (don't be angry Arch Users)
  • Easy to install/remove without breaking anything :)

Well, here is the blog post from Ruby blog!

Any other tips for today guys?

💖 💪 🙅 🚩
gugacavalieri
Guga Cavalieri

Posted on May 22, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related