Skip to content

Instantly share code, notes, and snippets.

@Marin-Kitagawa
Created September 20, 2021 10:39
Show Gist options
  • Save Marin-Kitagawa/b3367bb17d84df77b2fabc918dae4566 to your computer and use it in GitHub Desktop.
Save Marin-Kitagawa/b3367bb17d84df77b2fabc918dae4566 to your computer and use it in GitHub Desktop.
Snap installation, enabling and starting snap and Ruby installation via Snap and setting the latest Ruby as default
# Install necessary dependencies for installing Ruby
sudo apt install git curl libssl-dev libreadline-dev zlib1g-dev autoconf bison build-essential libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev
# Install `snap`
sudo apt install snapd
# Unmask `snapd.service`
sudo systemctl unmask snapd.service
# Enable `snapd.service`
sudo systemctl enable snapd.service
# Start `snapd.service`
sudo systemctl start snapd.service
# Install Ruby from snapstore
sudo snap install ruby --classic
# Uninstall in-built Ruby
sudo apt remove ruby
# Create symbolic link for ruby in `/usr/bin` from `/snap/bin/ruby` or export `/snap/bin/ruby` to `$PATH`
sudo ln -s /snap/bin/* /usr/bin
# Or
export PATH=$PATH:/snap/bin/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment