我一直無法安裝在OS X Lion上通過自制軟件安裝MySQL的mysql2 gem。我已經嘗試了許多標誌與安裝,我仍然沒有運氣。這裏是所有細節。如何在OS X Lion上使用自制軟件安裝MySQL時如何安裝mysql2 gem?
軟件的Mac OS X Lion的10.7(11A2063)
$ uname -a
Darwin Greenwood.local 11.0.1 Darwin Kernel Version 11.0.1: Wed Jun 29 19:53:22 PDT 2011; root:xnu-1699.23.2~1/RELEASE_X86_64 x86_64
$ which gcc | xargs ls -l
lrwxr-xr-x 1 root wheel 12 Aug 18 14:09 /usr/bin/gcc -> llvm-gcc-4.2
$ brew info mysql
mysql 5.5.14
$ which mysql
/usr/local/bin/mysql
$ which mysql_config
/usr/local/bin/mysql_config
$ ls -l /usr/local/bin/mysql*
$ ls -l /usr/local/lib/libmysql*
見這種要旨輸出:https://gist.github.com/1158628
$ sudo gem install mysql2
查看輸出在此要旨:https://gist.github.com/1158612
$ sudo find/-name mysql.h
/usr/local/Cellar/mysql/5.5.14/include/mysql.h
/usr/local/include/mysql.h
$ /usr/local/bin/mysql_config
見這種要旨輸出:https://gist.github.com/1158625
$ sudo env ARCHFLAGS="-arch x86_64" gem install mysql2 -- --with-mysql-config=/usr/local/bin/mysql_config
查看輸出在此要旨:https://gist.github.com/1158618
$ sudo env ARCHFLAGS="-arch x86_64" gem install mysql2 -- --with-mysql-dir=/usr/local
$ sudo gem install mysql2 -- --with-mysql-dir=/usr/local --with-mysql-config=/usr/local/bin/mysql_config
見輸出在這個要點:https://gist.github.com/1158645
我也試過這樣的回答: MySQL gem on OSX 10.7 Lion
感謝您的幫助!