Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save agilous/0e7e2bb0a2bc4a6dc5407bfdd95f56d8 to your computer and use it in GitHub Desktop.

Select an option

Save agilous/0e7e2bb0a2bc4a6dc5407bfdd95f56d8 to your computer and use it in GitHub Desktop.
Installing Ruby via asdf on Ubuntu Linux

Installing Ruby on Ubuntu Linux via asdf

1. Beginning with the Essentials & asdf

Run these commands in a terminal:

sudo apt-get install -y build-essential curl git linux-headers-`uname -r` wget
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.7.8
echo '. $HOME/.asdf/asdf.sh' >> ~/.bashrc
echo '. $HOME/.asdf/completions/asdf.bash' >> ~/.bashrc
. ~/.bashrc

2. We'll need SSL

Run this command in a terminal:

sudo apt-get install -y zlib1g-dev libssl-dev openssl

3. We'll also need SQLite

Run this command in a terminal:

sudo apt-get install -y sqlite libsqlite3-dev

4. Ruby, ruby, ruby, ruby, ruby!

Run these commands in a terminal:

asdf plugin-add ruby https://github.com/asdf-vm/asdf-ruby.git
asdf install ruby 2.7.1 # OR whichever version you prefer.

5. Bonus: Let's install NodeJS (needed for Ruby on Rails)

Run this command in a terminal:

sudo apt-get install -y nodejs npm

6. Bonus Bonus: Let's install the Atom editor!

Run these commands in a terminal:

wget -q https://packagecloud.io/AtomEditor/atom/gpgkey -O- | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://packagecloud.io/AtomEditor/atom/any/ any main"
sudo apt install atom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment