Ruby on Rails on Ubuntu
1. Install RVM:
In order, copy and paste the following commands.
- Add Repo (reference):
sudo apt-add-repository -y ppa:rael-gc/rvm
- Add Key Import Utility (reference):
sudo apt install gnupg2
- Add GPG Keys (reference):
gpg2 --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
- Install RVM:
sudo apt-get install rvm -y
- Add your user to rvm group (
$USER
will automatically insert your username):sudo usermod -a -G rvm $USER
- Now, in order to always load rvm, change the Gnome Terminal to always perform a login.
- At terminal window, open the application menu, then
Preferences
. Click onUnnamed
profile, select theCommand
tab and checkRun command as login shell
.
- At terminal window, open the application menu, then
- Open a new terminal window, then fix permissions and reboot:
rvmsudo rvm cleanup all && rvm fix-permissions && sudo reboot
2. Installing Ruby
In order, copy and paste the following commands.
- Configure RVM, Download, and Set Default Ruby (reference):
rvm get stable
rvm install 3.1.2
rvm --default use 3.1.2
- Check Version:
ruby -v
3. Installing Rails
In order, copy and paste the following commands.
- Configure the .gemrc file to skip the installation of Ruby documentation
echo "gem: --no-document" >> ~/.gemrc
- Install Rails with a specific version number:
gem install rails -v 7.0.4
- Check Version:
rails -v
Install Bundler:
-
Installing Bundler with a specific version number:
gem install bundler -v 2.3.14