DEV Community

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

Posted on

5 1

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?

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

Top comments (1)

Collapse
 
ali-alkhawaja profile image
Ali Al Khawaja

How did set-up Ruby-LSP with ruby ?
I am having a hard time installing it

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay