Ruby on Rails Installation Notes (2025-05-19)

✅ Step 1: Install Ruby (already done)

Verify Ruby and gem are installed:

ruby -v
gem -v

If not installed:

sudo apt update
sudo apt install ruby-full build-essential zlib1g-dev

✅ Step 2: Add Ruby Gems bin directory to PATH

If you see a warning about missing ~/.local/share/gem/ruby/3.0.0/bin in your PATH, add it:

For Bash:

echo 'export PATH="$HOME/.local/share/gem/ruby/3.0.0/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

For Zsh:

echo 'export PATH="$HOME/.local/share/gem/ruby/3.0.0/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

✅ Step 3: Install Rails using gem

gem install --user-install rails

✅ Step 4: Verify Rails installation

rails -v

If you get "command not found," check your PATH as in Step 2.


✅ Step 5: (Optional) Install Node.js and Yarn

Rails needs Node.js and Yarn for JavaScript and package management.

Install via apt:

sudo apt install nodejs yarnpkg

Or use nvm for latest Node.js:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc
nvm install --lts

🏁 Done! Create a new Rails app

rails new myapp
cd myapp
rails server

Written by A.M. Rinas