FROM 0 TO CODER: HOW TO SETUP MAC FOR RAILS, REACT, POSTGRES STACK
Tags: react, rails, ruby, postgres
Published: 2021-02-23 20:40:38

![](https://cdn-images-1.medium.com/max/3600/1*XnxDZJDweV_H6LMMI3bfwg.png)

Recently I noticed my Mac was bloated due to so much “other” data. I tried my hardest to use CleanMyMac (via [Setapp](https://setapp.com/)). In the end, I just decided to clean install.

Which meant all of my hard work to install Ruby, Node, and Postgres was gone! Which meant I had to learn how to do it all over again.

Learning opportunity and it’s so much easier than you think.

## TLDR;

Follow these steps, your system should work. Click on the numbers to go to their sections in the blog.

1. [First](#first-xcode): Download & Install [Xcode](https://apps.apple.com/us/app/xcode/id497799835?mt=12) or run sudo xcode-select --install in terminal.

1. Second: Download & Install Github Desktop and Homebrew, or just Homebrew, your choice. Then install CLI Tools via Github Desktop orbrew install gh

1. Third: run \curl -sSL https://get.rvm.io | bash -s stable --ruby

1. Fourth: [Postgresapp.com](https://postgresapp.com/downloads.html) or brew install postgresql (ONLY DO ONE!)

1. Fifth: [Node](https://nodejs.org/en/download/) download and install

1. Sixth: Breathe

![FROM ZERO TO HERO! JUST LIKE THAT.](https://cdn-images-1.medium.com/max/2000/0*UlXkiyDr4UUe8naX)*FROM ZERO TO HERO! JUST LIKE THAT.*

I’m currently using MacOS Big Sur (11.2.1), MacBook Pro 2019. Just in case you happen to be on a completely different version and you’re having issues.

## First: Xcode

The first thing I would do in install Xcode. Easiest thing. Go here, links to Mac App Store: [Xcode](https://apps.apple.com/us/app/xcode/id497799835?mt=12).

![](https://cdn-images-1.medium.com/max/2000/0*Gzlkts2lG1yw-Ksz)

or sudo xcode-select --install in terminal.

Why? — CLI Tools.

## Second: Github and Homebrew

Fun fact: Github Desktop makes it easier to install the cli tools and login to your account.

Go to [Github Download Page](https://desktop.github.com/).

Open terminal and enter:

/bin/bash -c "$(curl -fsSL [https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)](https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh))

To Install [Homebrew](https://brew.sh/).

Open Github Desktop and login, then click on ‘Github Desktop’ to reach the ‘Install Command Line Tool…” link.

![](https://cdn-images-1.medium.com/max/2000/0*G7nr2v1ZDNiv3iHj)

Alternatively, you can run: brew install gh in terminal, and that will do the trick.

However, consider installing the Github Desktop… it has many benefits: [Intro to GitHub Desktop](https://greyhatlinux.medium.com/intro-to-github-desktop-44b4e23b0dee)

## Third: Ruby & RVM (Ruby Version Manager)

Run the following command from Terminal. It will install RVM and the most recent stable version of Ruby.

\curl -sSL https://get.rvm.io | bash -s stable --ruby

Easy one line… if you want to know more about RVM or Ruby

Do not use brew to install Ruby… just because rvm and ruby work better together and I made the horrible mistake of install ruby through brew and then again through RVM and it was just… a mess.

## Fourth: PostgreSQL

You have two options: Postgresapp.com or Homebrew, either option works… but choose ONE! I also installed both on this step and the ‘port in use’ error is the absolute worst. If for some reason you run into this error run this: sudo pkill -u postgres

So option 1: [Postgresapp.com](https://postgresapp.com/downloads.html) — latest version as of this post is 13

option 2: brew install postgresql

brew is always the easiest and arguably the best option, but you're a beginner and a lot of this is brand new to you. Luckily there is documentation for everything online: [Postgres Docs](https://postgresapp.com/documentation/) | [Postgres Brew](https://formulae.brew.sh/formula/postgresql)

## Fifth: Node.js

Now we’re getting to the good stuff. Nodejs is Javascript. No doubt the easiest thing to do is to go to this link and download the pkg file: [Node](https://nodejs.org/en/download/)

Run the pkg file and check your node version in terminal by running: node --version (as of this, latest: v14.15.5 LTS or v15.8.0 current)

This download should also install the Node Package Manager or NPM. Check that by running npm --version

You could also install Node via NVM (Node Version Manager): curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash

then run

    env VERSION=`python tools/getnodeversion.py` make install DESTDIR=`nvm_version_path v$VERSION` PREFIX=""

then nvm use ##version number##

## Sixth: Breathe

You’ve installed (nearly) everything you need to get started. This has been a long journey. AND if it went anything like mine did… you’ll have take big sighs and considered giving up. But if you made it this far… you’re doing great!

## Seventh: Watch my newest Vlog!

So this vlog will show you how to take your recent installations and use it to create your first web app!