2010-08-23 117 views
0

有很多关于在Snow Leopard上安装ruby/rails mysql gem的信息,但是,它们似乎都不适合我。我想知道是否因为我使用Zend Server(CE)作为我的Web栈?使用Zend服务器无法在Snow Leopard上安装mysql gem

这里就是我运行安装宝石:

sudo env ARCHFLAGS="-arch x86\_64" gem install mysql -- --with-mysql-config=/usr/local/zend/mysql/bin/mysql_config 

而得到这个错误:

ERROR: Failed to build gem native extension. 
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb --with-mysql-config=/usr/local/zend/mysql/bin/mysql_config 
checking for mysql_ssl_set()... no 
checking for rb_str_set_len()... yes 
checking for rb_thread_start_timer()... yes 
checking for mysql.h... no 
checking for mysql/mysql.h... 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. 

有什么建议?

+0

哦,嗯,只是运行“mysql --version”,得到这个: /usr/local/zend/mysql/bin/mysql.client Ver 14.14 Distrib 5.1.47,for apple-darwin9.8.0(i386)使用readline 5.1 不是64位模式?但是,在没有ENV模式开关的情况下运行先前的命令仍会导致相同的错误。 – TylerNZ 2010-08-23 15:00:14

+0

因此,我下载了一个新版本的mysql并重新执行命令:sudo env ARCHFLAGS =“ - arch x86 \ _64”gem install mysql - --with-mysql-config =/src/mysql-5.1.50-osx10。 6-x86_64/mysql_config 立即获取新错误:/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb --with-mysql-config =/src/mysql-5.1。 50-osx10.6-x86_64/mysql_config extconf.rb:10:找不到命令:/src/mysql-5.1.50-osx10.6-x86_64/mysql_config --cflags *** extconf.rb失败*** – TylerNZ 2010-08-23 16:05:16

回答

0

好的,我继续为OSX 10.6(64位)编译一个全新的mysql版本,然后使用该新安装的路径运行gem install。然后成功创建了宝石。

我不会推荐使用自安装程序,因为它会覆盖来自Zend Server安装的一些设置。

所以,即使我有两个mysql安装,我仍然只引用一个 - 我甚至不知道如何引用第二个 - 但现在,我不需要。