Skip to content

Personal checklist for setting up a new Mac's dev environment.

License

Notifications You must be signed in to change notification settings

milanaryal/config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mac Dev Env Screenshot 2022-11-05 at 06 42 50


Config

Config is a basic checklist I follow to set up a new Mac's development environment. It gets me up to speed with Git, Ruby, Node.js, GitHub, Jekyll, Hugo, and more so I can more quickly get back to coding.

Checkout


Setup VS Code

i. Launch VS Code.

ii. Open the Command Palette Cmd+Shift+P and type shell command to find the "Shell Command: Install 'code' command in PATH command".

shell-command

iii. Restart the terminal for the new $PATH value to take effect. You'll be able to type code . in any folder to start editing files in that folder.

Setup Homebrew

  • Open Terminal app and run following commang to install Homebrew in your system:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  • Run these three commands in your terminal to add Homebrew to your PATH:
# ~/.zprofile <-> /users/milan/.zprofile

echo '# Set PATH, MANPATH, etc., for Homebrew.' >> /users/milan/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /users/milan/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

Once Homebrew has installed, you may want to opt out of the Homebrew analytics data sharing, which is enabled by default. To turn this off, you can set this variable in your environment:

export HOMEBREW_NO_ANALYTICS=1

Alternatively, this will prevent analytics from ever being sent:

brew analytics off

Homebrew auto install and setup xCode Command Line Tools. For manual installation open Terminal and trigger Xcode Command Line Tools installation: xcode-select --install.

If to uninstall Homebrew, read here. - Homebrew FAQ, Superuser

↥ To the top

Setup Ruby

  • Install rbenv via Homebrew:
brew install rbenv ruby-build
  • Set up rbenv in your shell. Run rbenv init and follow the printed instructions:
echo '# rbenv' >> ~/.zprofile
echo 'eval "$(rbenv init -)"' >> ~/.zprofile
  • Verify rbenv is configured properly:
type rbenv
  • Verify that rbenv is properly set up using rbenv-doctor script:
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/main/bin/rbenv-doctor | bash
# Download a version of Ruby via rbenv:
$ rbenv install 3.2.3

# Make it the global version of Ruby: 
$ rbenv global 3.2.3

# Additional dependencies:
$ gem install bundler

Installing and managing Ruby with rbenv allows us to specify versions of Ruby on a per-project basis. It also means we can avoid running sudo commands for installing gems and more as it's not affecting OS's system Ruby.

Having trouble with nokogiri? See https://stackoverflow.com/a/41491487.

↥ To the top

Setup Node.js

  • Install nodenv via Homebrew:
brew install nodenv
  • Set up nodenv in your shell. Run nodenv init:
echo '# nodenv' >> ~/.zprofile
echo 'eval "$(nodenv init -)"' >> ~/.zprofile
  • Verify nodenv is configured properly:
type nodenv
  • Verify that nodenv is properly set up using nodenv-doctor script:
curl -fsSL https://github.com/nodenv/nodenv-installer/raw/master/bin/nodenv-doctor | bash
  • Download a version of Node.js via nodenv:
# Download a version of Node.js via nodenv:
$ nodenv install 20.11.1

# Make it the global version of Node.js: 
$ nodenv global 20.11.1

# https://www.npmjs.com/package/npm-check-updates
$ npm install -g npm-check-updates

Learn more:

Installing and managing Node.js with nodenv allows us to specify versions of Node on a per-project basis. It also means we can avoid running sudo commands for installing global packages and more as it's not affecting OS's system Node.js.

↥ To the top

Setup Git

Please tell me who you are.

  • Run to set your account's default identity:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"

Omit --global to set the identity only in this repository. For privacy purpose use GitHub private email address id+username@users.noreply.github.com for git config.

↥ To the top

Setup GitHub CLI

brew install gh
gh auth login

See output.

gh repo clone milanaryal/config
cd milanaryal/config
gh repo sync

↥ To the top

Firefox Configuration Setup

Invitation

Sign-up with the following invitation link to get extra 500 MB bonus cloud space:

Brother's (@kshitizaryal):

About

Personal checklist for setting up a new Mac's dev environment.

Topics

Resources

License

Stars

Watchers

Forks