-
Notifications
You must be signed in to change notification settings - Fork 10
Setting up a new dev Mac
Make sure xCode is installed; if not, install it.
Once installed, open xCode's prefs and install anything seen here:
It can't hurt to check the "Check for and install updates automatically" checkbox. 👍
Install the developer command line tools:
$ xcode-select --install
… and follow the on-screen instructions.
$ java --request
… and click “More info…” to visit the Java Developer Kit download website.
On the Oracle site, select the “Accept License Agreement” option and download the latest MacOS installer (e.g., jdk-8u102-macosx-x64.dmg
). Run the installer.
Now's a good time to setup your command line bits. Here's mine. Installing now …
I currently prefer ST3. Installing now!
Here's my personal ST3 installation and setup instructions.
Install Homebrew like so:
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Most up-to-date instructions can be found on the Homebrew landing page.
Once installed, immediately run:
$ brew update
$ brew upgrade
$ brew doctor
Fix any issue that may arise. Follow the on-screen instructions.
At this point, now that xCode and Homebrew are installed, restart your machines and open xCode; agree to anything it asks.
Run $ brew doctor
again.
$ brew install bash-completion
See: Upgrade bash on OS X
Get Node:
$ brew install node
That will install Node.js which comes with npm.
Upgrade Node using Brew:
$ brew upgrade node
# Everything:
$ brew upgrade
When you install, or upgrade, Node/npm, you might see:
If you update npm itself, do NOT use the npm update command.
The upstream-recommended way to update npm is:
npm install -g npm@latest
You’d be wise to follow those instructions. 👍
Note: There’s lots of good Brew-usage tips here.
At the command line prompt:
$ \curl -sSL https://get.rvm.io | bash -s stable --ignore-dotfiles --autolibs=enable --ruby
That will install a fresh copy of Ruby and turn on autolibs without modifying your user’s dot files.
Once installed, run:
$ source /Users/mhulse/.rvm/scripts/rvm
Add this to your .bash_profile
:
# Load RVM into a shell session *as a function*:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
Reload your current terminal session:
$ source ~/.bash_profile
From here on out, use these commands to keep things current:
# Update rvm:
$ rvm get stable
# Update rvm Ruby:
$ rvm install current && rvm use current
# Update rvm gems:
$ gem update
I’d restart your machine at this point.
See also: Ruby tips
Like pyvenv
for Python, Bundler provides a consistent environment for Ruby projects, so … let’s install it:
$ gem install bundler
I have example Bundler usage instructions here.
At the command line prompt:
$ brew install python3
Add these aliases to your profile (e.g., .bash_profile
):
# Default Python
alias python=python3.4
# Default pyvenv
alias pyvenv=pyvenv-3.4
# Default pip
alias pip=pip3.4
The above aliases make it easier to run the latest Python (and pip
) on your system.
# Pip, setuptools, and wheel have been installed. To update them:
$ pip3 install --upgrade pip setuptools wheel
Reload:
$ source ~/.bash_profile
Now you can create a pyvenv
and use pip to install packages within your environment.
See also: Django local dev
$ brew install git
If using GitHub or BitBucket, you will want to setup SSH keys for both:
Setup XAMPP: Mac.