how to setup ruby on rail in windows


how to setup ruby on rail in windows

 STEP 1 — Install Linux (WSL)

In PowerShell (Admin) run:

wsl --install

Wait till it finishes.
Then restart your laptop.


🧰 STEP 2 — Open Ubuntu

After restart:

  • Press Windows key

  • Search Ubuntu

  • Open it

It will ask:

Enter new UNIX username: Enter new UNIX password:

Type anything and remember it.

Now you are inside Linux (this is where Rails will run).


🧰 STEP 3 — Update Linux

In Ubuntu terminal run:

sudo apt update && sudo apt upgrade -y

🧰 STEP 4 — Install Ruby build dependencies

Run:

sudo apt install -y libssl-dev libreadline-dev libyaml-dev libgmp-dev zlib1g-dev rustc build-essential

This replaces all those brew install commands you saw on YouTube.


🧰 STEP 5 — Install rbenv (Ruby Version Manager)

sudo apt install rbenv -y

Then:

rbenv init

Close Ubuntu terminal and open it again.


🧰 STEP 6 — Install Ruby

rbenv install 3.3.0 rbenv global 3.3.0 ruby -v

If it shows 3.3.x → success ✅


🧰 STEP 7 — Install Node.js (Rails needs it)

sudo apt install nodejs npm -y node -v

🧰 STEP 8 — Install Rails

gem install rails rails -v

🧰 STEP 9 — Install PostgreSQL

sudo apt install postgresql postgresql-contrib libpq-dev -y

🚀 STEP 10 — Create Your First Rails App

rails new myapp -d postgresql cd myapp rails db:create rails server

Open browser:

http://localhost:3000

🎉 Your Rails app is running!


🧠 IMPORTANT RULE

Always use:

Ubuntu terminal
Never use:

Windows CMD or PowerShell for Rails 

how to setup ruby on rail in windows how to setup ruby on rail in windows Reviewed by Shubham Prajapati on January 09, 2026 Rating: 5

No comments:

If you have any doubt so you can comment me then i will 100% help you ,Through comment Chat

Powered by Blogger.