安装Mysql2 gem-10.6服务器时出错 [英] Error installing Mysql2 gem- 10.6 Server

查看:92
本文介绍了安装Mysql2 gem-10.6服务器时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在10.6服务器上安装mysql2 gem,并且收到一条我没有看到的错误消息:

I'm trying to install the mysql2 gem on 10.6 server and I get an error message I haven't seen:

EBuilding native extensions.  This could take a while...
ERROR:  Error installing mysql2:
    ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... no
checking for mysql.h... no
checking for mysql/mysql.h... no
-----
mysql.h is missing.  please check your installation of mysql and try again.
-----
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
    --with-mysql-config
    --without-mysql-config


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/ext/mysql2/gem_make.out

我尝试了几件事情,指定内置MySQL的存储位置 sudo gem install mysql2 - --with-mysql-dir = / var / mysql ,并用mysql.com预置的64位安装程序替换内置的mysql。

I've tried a couple things, specifying where the built-in MySQL is stored sudo gem install mysql2 -- --with-mysql-dir=/var/mysql and also replacing the built-in mysql with the pre-built 64-bit installer from mysql.com

任何想法?

推荐答案

想象一下:

Figured it out:

sudo env ARCHFLAGS="-arch x86_64" gem install mysql2 -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

这篇关于安装Mysql2 gem-10.6服务器时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆