Install Xcode, Ruby, Rails, Git, Homebrew, Mongo on New Mac OS X
Xcode
Download Xcode (this can take a while). After installing go to xcode preferences via the menu bar click on downloads -> Install (next to Command Line Tools).
Check if gcc was installed correctly.
gcc -version
RVM (Ruby Environment Manager)
Download and install rvm using Curl
bash <<(curl -s https://rvm.beginrescueend.com/install/rvm)
Once this runs without any error add the below code into your bash profile. If it does not exist create one ~/.bash_profile.
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
After this you can check for different Ruby implementations
rvm list known
rvm list (this will display the Ruby versions installed on your machine).
Ruby
This one is pretty simple now just add the version of ruby at the end of rvm install.
rvm install 1.9.3
To use a particular version of Ruby
rvm use 1.9.3
To make a particular version of Ruby default
rvm --default use 1.9.3
To use system default version of Ruby
rvm use system
Homebrew
Homebrew is a package environment for OS X. It installs the missing packages
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
$brew should not throw any error
Rails
gem install rails
Git
Install git using brew
brew install git
Configure git with your username and email
git config --global user.name "name"
git config --global user.email "email"
Mongo
Install mongo using brew
brew install mongodb
start up using mongod