Installing Prerequisite Packages and Ruby 2.6.1 on Ubuntu 18.04

Install required packages for Rails 5.2 stack. SSH into the server as deploy user and run:

curl -sL | sudo -E bash -
curl -sS | sudo apt-key add -
echo "deb stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update
sudo apt-get install -y git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev nodejs yarn

Install Ruby using RVM

sudo apt-get install -y libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
gpg --keyserver hkp:// --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
curl -sSL | bash -s stable
source ~/.rvm/scripts/rvm
rvm install 2.6.1
rvm use 2.6.1 --default
ruby -v

Bundler is already shipped with the Ruby. We don't need to run: gem install bundler. Next step is to use these steps in a shell script and automate the installation process by using Vagrant as the provisioner.


Do not ignore any errors. If you get:

GPG signature verification failed for '/home/deploy/.rvm/archives/rvm-1.29.7.tgz' - ''! Try to install GPG v2 and then fetch the public key:

Follow the suggested action:

gpg --keyserver hkp:// --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB

This will install RVM.

Related Articles

Ace the Technical Interview

  • Easily find the gaps in your knowledge
  • Get customized lessons based on where you are
  • Take consistent action everyday
  • Builtin accountability to keep you on track
  • You will solve bigger problems over time
  • Get the job of your dreams

Take the 30 Day Coding Skills Challenge

Gain confidence to attend the interview

No spam ever. Unsubscribe anytime.