How can you install the mysql2 gem when MySQL was installed with homebrew on OS X Lion? [closed]
I've been unable to install the mysql2 gem with MySQL installed via homebrew on OS X Lion. I've tried a multitude of flags with the install, and I've still had no luck. Here are all the details.
Software 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/l开发者_如何学Pythonocal/bin/mysql*
$ ls -l /usr/local/lib/libmysql*
See output in this gist: https://gist.github.com/1158628
$ sudo gem install mysql2
See output in this gist: 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
See output in this gist: https://gist.github.com/1158625
$ sudo env ARCHFLAGS="-arch x86_64" gem install mysql2 -- --with-mysql-config=/usr/local/bin/mysql_config
See output in this gist: 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
See output in this gist: https://gist.github.com/1158645
I also tried this answer: MySQL gem on OSX 10.7 Lion
Thanks for the help!
I uninstalled and reinstalled MySQL with homebrew, and I was able to install the gem.
精彩评论