Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 从gems Mac 10.6安装mysql时出错_Ruby On Rails_Macos_Rubygems_Installation - Fatal编程技术网

Ruby on rails 从gems Mac 10.6安装mysql时出错

Ruby on rails 从gems Mac 10.6安装mysql时出错,ruby-on-rails,macos,rubygems,installation,Ruby On Rails,Macos,Rubygems,Installation,我见过这个问题的各种变体,但到目前为止没有一个是正确的答案 我正在尝试从rubygems安装mysql,并获得以下信息: Building native extensions. This could take a while... ERROR: Error installing mysql: ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework/Versi

我见过这个问题的各种变体,但到目前为止没有一个是正确的答案

我正在尝试从rubygems安装mysql,并获得以下信息:

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

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... no
*** 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
    --with-mysql-dir
    --without-mysql-dir
    --with-mysql-include
    --without-mysql-include=${mysql-dir}/include
    --with-mysql-lib
    --without-mysql-lib=${mysql-dir}/lib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-mlib
    --without-mlib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-zlib
    --without-zlib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-socketlib
    --without-socketlib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-nsllib
    --without-nsllib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-mygcclib
    --without-mygcclib
    --with-mysqlclientlib
    --without-mysqlclientlib


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/mysql-2.8.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out
我尝试过像--with mysql config=/usr/local/mysql/bin/mysql\u config这样的参数,但仍然得到相同的结果

从mysql网站手动安装,但我无法启动它


有什么想法吗?

看起来你已经安装了MySQL,但是你没有它的开发头。您可能需要下载并安装具有这些功能的版本

我非常喜欢用它来做这件事,不过这会给你留下一个稍微不规则的名字,MacPorts称之为mysql\u config5。我通常将此符号链接以修复名称:

ln -s /opt/local/bin/mysql_config5 /opt/local/bin/mysql_config

您可以对任何具有不寻常名称的二进制文件(如mysql5和mysqladmin5)执行此操作。

我将其用于Rails开发初学者。愚蠢的问题,这对MacPorts来说不是问题吗?MacPorts是一个基于源代码的安装,所以您可以将所有开发头作为包的一部分。许多二进制安装缺少这种节省空间的功能。你也可以试试看什么最适合你。