当 MySQL 在 OS X Lion 上通过自制程序安装时,如何安装 mysql2 gem?
我无法在 OS X Lion 上通过自制程序安装 MySQL 并安装 mysql2 gem。我在安装时尝试了多种标志,但仍然没有运气。以下是所有详细信息。
软件 Mac OS X Lion 10.7 (11A2063)
$ uname -a
Darwin Greenwood.local 11.0.1 Darwin 内核版本 11.0.1:6 月 29 日星期三 19:53 :2011 年太平洋夏令时间 22 日; root:xnu-1699.23.2~1/RELEASE_X86_64 x86_64
$ 其中 gcc | xargs ls -l
lrwxr-xr-x 1根轮 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
我也尝试过这个答案: OSX 10.7 Lion 上的 MySQL gem
感谢您的帮助!
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/local/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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我用 homebrew 卸载并重新安装了 MySQL,并且能够安装 gem。
I uninstalled and reinstalled MySQL with homebrew, and I was able to install the gem.