mysql2的官方網站:https://github.com/brianmario/mysql2
前提:
使用homebrew,並且安裝好mysql,裏面同時包括了開發包
# brew install mysql
安裝步驟:
$ git clone git://github.com/brianmario/mysql2.git$ cd mysql2
$ gem build mysql2.gemspec
$ gem install mysql2-0.3.12b4.gem -- --with-mysql-config=/usr/local/Cellar/mysql/5.5.27/bin/mysql_config
從此可以支持4字節的utf8了,iphone的Emoji表情符號可以無縫的存儲了。
大功告成!