开发者

How can you install the mysql2 gem when MySQL was installed with homebrew on OS X Lion? [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 11 years ago.

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜