Sunday, November 4, 2012

Set Up RoR development environment for Mac OS X 10.8.2

1. Set up Git
http://code.google.com/p/git-osx-installer/downloads/detail?name=git-1.8.0-intel-universal-snow-leopard.dmg&can=3&q=&sort=-uploaded
Although it's named as Snow Leopard, it works with Mountain Lion.

1b. Set up Git merge tool:
+ Install p4merge
+ Create a new text file in /usr/local/bin called p4merge, make it executable, and add following lines:
#!/bin/sh
/Applications/p4merge.app/Contents/MacOS/p4merge $*

+ Create a new text file in /usr/local/bin call p4diff, make it executable and add following lines:
#!/bin/sh
[ $# -eq 7 ] && /usr/local/bin/p4merge "$2" "$5"

+ Open your git configuration file (probably ~/.gitconig) and add these lines:
[merge]
 keepBackup = false;
 tool = p4merge
[mergetool "p4merge"]
 cmd = p4merge "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
 keepTemporaries = false
 trustExitCode = false
 keepBackup = false
[diff]
 external = p4diff

 2. Install Command Line Tools for Xcode (OS X Mountain Lion) if you don't want to install the whole Xcode
https://developer.apple.com/downloads/index.action

3. Install rvm and ruby 1.9.3
curl -L https://get.rvm.io | bash -s stable
source /Users/phucquang/.rvm/scripts/rvm
rvm install 1.9.3
rvm use 1.9.3
rvm --default 1.9.3

4. Enabling Apache - Using 3rd party Preference Panel
http://amz.clickontyler.com/WebSharing.dmg
OR 3rd party application (recommended)
http://clickontyler.com/virtualhostx/

4b. Starting built-in Apache server automatically.
sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist

5. Install MySQL
Go to http://dev.mysql.com/downloads/mysql/#downloads, and download Mac OS X ver. 10.6 (x86, 64-bit), DMG Archive

6. Install homebrew
ruby < (curl -fsSk https://raw.github.com/mxcl/homebrew/go)

7. Install ImageMagick
brew install imagemagick --use-tiff 

No comments: