DEV Community

Cover image for Install latest version of Ruby and Rails using Snap
Guga Cavalieri
Guga Cavalieri

Posted on

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


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

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?

Top comments (0)