over 5 years ago

Step1.請參見mac os安裝清單

(1) OpenOffice
(2) Paintbrush
(3) Evernote
(4) GIMP on OS X(開源版的PhotoShop, 非必要)
(5) Xcode + xcode commad line tools
(6) SourceTree (Git/Hg) (好用程度不輸 git tower)
(7) Sequel Pro / MySQL Workbench (2選1)
(8) Oracle VM VirtualBox
(9) Sublime Text 2 (輕快的程式編輯軟體)
(10) DropBox
(11) Yahoo KeyKey (Yahoo 輸入法)
(12) MacFUSE + NTFS-3G (讓Mac可讀NTFS格式的USB,檔案格式等等..)
(13) Simplyrar (類似pc上的winrar)
(14) Welly(BBS)
(15) Magican (多合一軟體, 清理垃圾、病毒、監控CPU、溫度等等..)
(16) Winamp (音樂播放器)

Step2.安裝Xcode

(1)請至App Store搜尋Xcode, 來安裝最新版本
(2)下載Xcode Command Line Tools
連至https://developer.apple.com/downloads/index.action
並登入, 尋找如圖下所示


(3)安裝Xcode Command Line Tools

Step3.安裝homebrew

http://ruby-china.org/topics/9090 (正解)
https://github.com/mxcl/homebrew/wiki/installation (官方參考)

指令:

$ mkdir -p /usr/local/Cellar
$ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
$ brew doctor
$ brew update
$ brew install wget

Step4.利用Homebrew安裝Mac開發套件

$  brew install git ack wget curl redis memcached libmemcached colordiff imagemagick nginx sqlite libxml2 libxslt readline v8 rsync sphinx geoip lzo git-flow

Step5.安裝Mysql

$ brew install mysql

如果是重安裝記得先

$ launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
$ rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
$ unset TMPDIR

$ mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql –tmpdir=/tmp

$ mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp

mysql可用指令

mysql.server start
mysql.server stop

Step6.設定Mysql

設定mysql root 密碼(第一次安裝)

$ /usr/local/Cellar/mysql/5.6.10/bin/mysqladmin -u root password 'my_pwd'

設定mysql root 密碼(重灌)

$ /usr/local/Cellar/mysql/5.6.12/bin/mysqladmin -u root -p password 'my_pwd'

以後開機, 自動啟動mysql

$ mkdir -p ~/Library/LaunchAgents/
$ cp /usr/local/Cellar/mysql/5.6.10/homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/
$ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist

如果安裝的是MySQL5.6的話,要注意(MySQL5.5可以跳過)
Mysql5.6有bug所以可能要額外設定my.ini檔

Step7.安裝graphicsmagick

http://blog.yslin.tw/2012/05/os-x-graphicsmagick-pgmagick.html

$ brew install graphicsmagick
$ wget --no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh

安裝玩之後記得別急著按Enter, 他要求你輸入密碼之後才會切換Zsh

Step8.安裝RVM

指令:

$ bash -s master < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)

$ echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile

$ source ~/.bash_profile

Step9.在RVM安裝Rubys

參考:
http://ruby-china.org/topics/8589#reply24

指令:

$ rvm list known
$ rvm install 1.9.3-head
$ rvm install 2.0.0-p195

$ rvm use 1.9.3-head --default
$ rvm rubygems current

$ rvm use 2.0.0-p195 -–default
$ rvm rubygems current

$gem source -r http://rubygems.org

$ gem install bundler

$ gem install rails -v=3.2.13

如果有出現沒辦法安裝gem的狀況就...

$ rvm pkg install openssl
$ rvm reinstall all --force

可參考
http://www.frederico-araujo.com/2011/07/30/installing-rails-on-os-x-lion-with-homebrew-rvm-and-mysql/

開啟最高權限
http://philip.pixnet.net/blog/post/14834238-%5Bmac%5D%E5%9C%A8mac%E4%B8%8A%E9%96%8B%E5%95%9F%E6%9C%80%E9%AB%98%E6%AC%8A%E9%99%90%E8%A8%AD%E5%AE%9A

← Octopress - 使用篇 關於Ruby的yield →