【问题标题】:How can you install the mysql2 gem when MySQL was installed with homebrew on OS X Lion? [closed]当 MySQL 在 OS X Lion 上与 homebrew 一起安装时,如何安装 mysql2 gem? [关闭]
【发布时间】:2011-08-20 04:00:20
【问题描述】:

我一直无法在 OS X Lion 上通过 homebrew 安装 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

感谢您的帮助!

【问题讨论】:

    标签: mysql ruby gem homebrew


    【解决方案1】:

    我用自制软件卸载并重新安装了 MySQL,并且能够安装 gem。

    【讨论】:

      猜你喜欢
      • 2011-11-16
      • 2012-08-10
      • 1970-01-01
      • 2013-12-21
      • 2011-06-25
      • 2013-10-09
      • 2011-11-26
      • 1970-01-01
      • 2012-10-18
      相关资源
      最近更新 更多