Skip to content

Instantly share code, notes, and snippets.

@abdallahokasha
Last active November 12, 2022 20:47
Show Gist options
  • Save abdallahokasha/e3f4fe0e5f494c1520c568afcccb9211 to your computer and use it in GitHub Desktop.
Save abdallahokasha/e3f4fe0e5f494c1520c568afcccb9211 to your computer and use it in GitHub Desktop.
How to install Rails and RVM on Ubuntu

Install rvm

sudo apt-get install software-properties-common

  1. Add the PPA and install the package

Open a terminal (Ctrl+Alt+T) and run:

sudo apt-add-repository -y ppa:rael-gc/rvm
sudo apt-get update
sudo apt-get install rvm

Solve the problem of rvm command not found on terminal.

echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bashrc

and then source ~/.bashrc and then restart needed.

Open terminal after restart and run rvm -v

Install ruby using rvm rvm install ruby-2.5.1 and we can see all packages installed using rvm list

Needed to run sudo apt install ruby although i ran rvm install ruby-2.5.1 !!

RubyGems is a Ruby Package Manager, coming with the gem command-line tool. It's automatically installed when we install Ruby on the system. we can check using gem -v

Update gem to the latest version and check it. gem update --system

See the updated version gem -v

Install rails using gem gem install rails -v 5.2.0 after that we can see list of installed gems using gem list

For sure we can run rails -v

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment