s-duha
Last Updated: February 25, 2016
·
3.36K
· jjperezaguinaga
Me 180x180

Setting up a new Mac OSX Lion for Development

Setup new Mac with OSX Lion from scratch

Latest update 20-Oct-2012.
me@jjperezaguinaga.com

Install Command Line Tools for Xcode

Command Line Tools are required for Homebrew. Previously it was suggested to download Xcode 4, but since the new version doesn't ship the proper gcc compiler for rvm, the command line tools are a better option and then using homebrew to get the gcc compiler. If preferred, install Xcode 4, although this setup doesn't follow that set of instructions.

iTerm2

Really the nicest choice for a terminal on OSX right now, especially with Lion style full screen support.

Homebrew

ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"

Note that Xcode is a pre-req for Homebrew

Set shell to ZSH and install oh-my-zsh

curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh

restart iTerm2

SCM

Git

brew install git

http://help.github.com/mac-set-up-git/

Mercurial

brew install mercurial

Copy over your SSH Keys from your existing machine if you have them and want to carry over your existing SSH configs.

RVM

\curl -L https://get.rvm.io | bash -s stable --ruby=rbx --gems=rails,puma

First make sure you run rvm requirements afterwards, and if required rvm reinstall all --force. Also note this command installs rails and puma. If you want plain Ruby use:

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

Some of instructions to pay attention to from rvm requirements:

Install of apple-gcc42

brew update
brew tap homebrew/dupes
brew install autoconf automake apple-gcc42
rvm pkg install openssl

Install Libksba for Ruby 1.9.3

brew install libksba

To use an RVM installed as default, instead of the system ruby:

rvm install 1.9.3 # installs patch 286: closest supported version
rvm system ; rvm gemset export system.gems ; rvm 1.9.3 ; rvm gemset import system.gems # migrate your gems
rvm alias create default 1.9.3  # don't forget to restart your terminal

.zshrc

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"  # This loads RVM into a shell session.

Start new shell session

Install ruby

rvm install 1.9.2
rvm install 1.8.7
rvm notes

See if there is anything in the rvm notes you need to take action on. As of this writing the compiler needs to be overridden.

Create a ~/.gemrc file and add the line

gem: --no-ri --no-rdoc

rvm --default 1.8.7
rvmsudo gem install bundler
rvmsudo gem install lunchy

Node.js

nvm

From home (zsh may try to convert nvm to .nvm. Go nay):
git clone git://github.com/creationix/nvm.git ~/.nvm

.zshrc

[[ -s "$HOME/.nvm" ]] && . "$HOME/.nvm/nvm.sh"

node.js

nvm install v0.8.12
nvm alias default 0.8

Unlike RVM that adds the binary version of the node to .zshrc, you need to do it manually according to the version you are using. So for instance:

PATH=$PATH:$HOME/.nvm/v0.8.12/bin # Add NVM to PATH for scripting

npm (Latest version of Node already have npm included)

curl http://npmjs.org/install.sh | sh

VirtualBox

Vagrant

gem install vagrant
$ vagrant box add base http://files.vagrantup.com/lucid64.box
$ vagrant init
$ vagrant up

ievms

https://github.com/xdissent/ievms

Download and unpack ievms:

Install IE versions 6, 7, 8 and 9.

curl -s https://raw.github.com/xdissent/ievms/master/ievms.sh | bash

Install specific IE versions (IE7 and IE9 only for example):

curl -s https://raw.github.com/xdissent/ievms/master/ievms.sh | IEVMS_VERSIONS="7 9" bash

Launch Virtual Box.

Choose ievms image from Virtual Box.
Install VirtualBox Guest Additions (pre-mounted as CD image in the VM).
IE6 only - Install network adapter drivers by opening the drivers CD image in the VM.

Say Thanks
Respond

4 Responses
Add your response

4038
50c3b4dba814ed7e4c0d970d9f382e3d

I just looked at the Vagrant website. But still not sure what its for?

over 1 year ago ·
4048
Me 180x180

@reneruiz Vagrant is a virtualization tool. Helps you manage Virtual Machines (VM) provided by Virtual Box in order to provide development environments, so you don't have to install packages directly in your workstation. Other benefits include provisioning and the ability to replicated production environments.

over 1 year ago ·
5554
over 1 year ago ·
5555
Me 180x180

@darragh Yep, Seiichi Yonezawa wrote a nice tip about how to use it. I think it's still around Coderwall, but somehow it's not longer there. Might check the cache

over 1 year ago ·