loading...

How I upgrade my Mac for development in Catalina macOS

sakko profile image SaKKo Updated on ・4 min read

My previous post How I setup my Mac for development will work just fine with older macOS.

But now that it's Catalina, bash has been changed to zsh and I want to note my setup and other findings here.

Most of the steps are the same except nvmrc part

Check / Set my home folder

I sometime see people use long username in home folder. I usually go with short and easy to remember username. Mine is sakko.

To check, type open terminal and type pwd

$ pwd
/Users/sakko

If it's not what you like, find a way to change it now before continuing. It will be extremely difficult to change this after a few months.

Install Xcode

Download Xcode from here https://developer.apple.com/download/more/ or the Apple App Store.

Then try creating a single page app iOS project. Run the project to see if it build successfully.

Install Xcode Command Line Tools

Open terminal and type

$ xcode-select --install

Then click install to continue

Configure git config

Open terminal and input these (replace your name and email)

$ git config --global user.name "John Doe"
$ git config --global user.email "john.doe@gmail.com"

Setup global .gitignores

Mac has some annoying files that can be ignored by git. Let's add them.

$ nano ~/.gitignore

Then add these

# Node
npm-debug.log

# Mac
.DS_Store
.AppleDouble
.LSOverride

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# Windows
Thumbs.db

# WebStorm
.idea/

After you are done, activate this globally by running

$ git config --global core.excludesfile ~/.gitignore

install iterm2

https://iterm2.com/

install oh my zsh

fully explained here https://github.com/robbyrussell/oh-my-zsh

but for quick installation just run

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

then restart terminal

Install NVM

For nodejs development, open https://github.com/nvm-sh/nvm

copy the installation line (eg.)

$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.1/install.sh | bash

Open ~/.zshrc and see if these lines are present. (if not, add it)

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

If you are using .nvmrc in your projects to activate node version like .ruby-version, then you might want to install nvm-auto from https://github.com/dijitalmunky/nvm-auto

run this line by line

cd ~/.oh-my-zsh/custom/plugins
git clone https://github.com/dijitalmunky/nvm-auto.git
sed -e 's/^plugins=(\(.*\))/plugins=(\1 nvm-auto)/' -i .pre-nvm-auto ~/.zshrc
echo 'nvm_auto_switch' >> ~/.zshrc
source ~/.zshrc

Restart terminal then install nodejs (only the version you use)

$ nvm install 10.16.0
$ nvm install node    # this will install latest

Install Ruby

I'm a Rails developer so I need ruby as well. I choose rvm (like nvm) to manage versions and gemsets.

Simply run the command below and follow what's prompted.

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

When it's done, restart terminal once, to get rvm loaded.

Install ruby, I use 2.5.3 and 2.6.3 at the moment

$ rvm install 2.5.3
$ rvm install 2.6.3

I don't like document to be installed (to save space) so I usually globally ignore it. (Not sure if this is necessary anymore)

$ echo "gem: --no-document" >> ~/.gemrc

Then install latest version of Rails

$ gem install rails

Homebrew, Postgresql, MySql, ElasticSearch, Redis and other apps

RVM will install Homebrew for you, so you don't need to reinstall it.

So let's install other apps

# image processing
$ brew install imagemagick gs vips

# postgresql or postgresql@11
$ brew install postgresql
$ brew services start postgresql # to start service

# mysql
$ brew install mysql
$ brew services start mysql # to start service

# redis
$ brew install redis
$ brew services start redis # to start service

# memcached
$ brew install memcached
$ brew services start memcached # to start service

Installing ElasticSearch require Java8 you can download them from here.

Agree with the terms or use openjdk from Homebrew

$ brew tap AdoptOpenJDK/openjdk
$ brew cask install adoptopenjdk8

Then install ElasticSearch

# elasticsearch
$ brew install elasticsearch
$ brew services start elasticsearch # to start service

Android development + React-Native

The best tutorial is the official one.

https://facebook.github.io/react-native/docs/getting-started

Other Apps I use

  • Atom.io
  • VSCode
  • Sublime
  • iTerm2
  • Alfred
  • 1Password
  • Little Snitch
  • iStat Menus

Atom packages

I usually start with these packages, (you need to install shell command from atom application menu first)

apm install atom-beautify blame console-log editorconfig emmet es6-javascript language-docker language-javascript-jsx language-plantuml language-vue linter linter-swagger linter-ui-default plantuml-preview prettier-atom rails-snippets react react-es6-snippets ruby-block set-syntax indent-guide-improved

Sublime

I usually use Sublime if I want to quickly open some file (especially JSON). Since it's the fastest editor I can find with all the features I need. These are the packages I usually use.

Babel
Emmet
GitGutter
JsPrettier
JSX
JsFormat

Also enable CLI with

sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl

Other stuffs,

Docker - not yet, I'm saving my precious 256GB ssd T____T

python, gcloud, ansible, blah blah blah..... too many to add. Install them later.

Posted on by:

Discussion

markdown guide
 

Additional:

Xcode needs to be updated
------------ developer.apple.com/download/

NFS in docker
----------- firehydrant.io/blog/nfs-with-docke...

Endpoint security VPN
---------- supportcontent.checkpoint.com/file...

Also sadly Apache Directory Studio does not work with Catalina so a replacement is needed if used.

 

Thanks for this article. I'm having issues with installing RVM the way you have described.... I always get this error:

mkdir: /User_Provile.rvm/src: Read-only file system

Did you run into this? I have followed the same procedure described.

 

It looks like my .rvm folder was moved into the "Relocated Items" folder on my desktop as part of the Catalina upgrade... Can't figure out where to move this folder to make it compatible again.

 

i always clean install new OS to prevent this. Not sure if you can just delete it and reinstall r again.

Do you mind sharing what the path to your .rvm folder installs to through your process so that I can verify that I've moved it to the same location

 

Few years ago I've also installed everything manually, but now I know how to docker databases and so on. My life is much, much easier. Especially when you have to use same database with different version for different projects.

 

i have to save disk space, this one only has 256gb.

 

Nice write up. Thanks for this it helped me to get nvm, node, npm back after updating to Catalina.

 

good to hear, happy to write

 

Helpful article, the export NVM_DIR part bailed me out.
Thanks