Cheatsheet for Setting up WSL, Ruby on Rails and React local development environment for Windows 10

Jonathan Luk
2 min readSep 24, 2020

Every time I get a new PC or re-install Windows I had to do some digging to set up my development environment all over again, but this time I figured I’d document all the steps into this nifty little copy&paste cheatsheet.

Install Windows Subsystem for Linux

1) Go to “Turn Windows features on or off” by either clicking the Windows button and start typing “features”, or go to Control Panel > Programs > Turn Windows features on or off

2) Check the box for “Windows Subsystem for Linux”

3) Restart Windows after installation

4) Download Terminal from the Microsoft App Store

5) Download Ubuntu from the Microsoft App Store and launch

6) Enter a UNIX username and password to create user account

Configure Windows Terminal to launch with Ubuntu as default

1) Launch the Windows Terminal and select Settings from the dropdown arrow on the menu bar

2) Replace the guid value for “defaultProfile” with the guid value of Ubuntu listed under “profiles”[“list”]

3) Run command sudo apt-get update

- updates your index files to match the current contents of the repositories

4) Run command sudo apt-get upgrade

- updates system

Install NVM and Node

1) Go to https://github.com/nvm-sh/nvm, copy & paste the curl command to install nvm, something like:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

2) Restart terminal, type nvm to check whether nvm was installed

3) Run nvm install <LTS version number of node> in terminal

Install yarn

1) Run curl -o- -L https://yarnpkg.com/install.sh | bash in terminal

Install rbenv, Ruby, Bundler and Rails

Install dependencies:cdsudo apt-get updatesudo apt-get install 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

Install rbenv:

git clone https://github.com/rbenv/rbenv.git ~/.rbenv

echo ‘export PATH=”$HOME/.rbenv/bin:$PATH”’ >> ~/.bashrc

echo ‘eval “$(rbenv init -)”’ >> ~/.bashrc

exec $SHELL

Install ruby-build:

git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build

echo ‘export PATH=”$HOME/.rbenv/plugins/ruby-build/bin:$PATH”’ >> ~/.bashrc

exec $SHELL

rbenv install 2.7.1

rbenv global 2.7.1

ruby -v

gem install bundler

source: https://gorails.com/setup/windows/10

Configuring Github

1) git config — global user.name “<name>”

2) git config — global user.email “<email>”

3) generate ssh key , see: https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

a. run ssh-keygen -t rsa -b 4096 -C your_email@example.com

b. press enter then enter passphrase

4) add ssh key to the ssh-agent

a. run eval $(ssh-agent -s)

b. run ssh-add ~/.ssh/id_rsa

c. copy the key with clip < ~/.ssh/id_rsa.pub, or cat ~/.ssh/id_rsa.pub and copy output

5) sign into Github then click on your Avatar > Settings > SSH and GPG keys > New SSH key, and then paste in the key, add title and click Add SSH key

--

--