gem安装mysql失败 [英] gem install mysql fail

查看:124
本文介绍了gem安装mysql失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照 http://geryit.com/blog/2011/01/installing-mysql-with-rails-on-mac-os-x-snow-leopard/ ,包括安装红宝石通过macport。



每当我执行 gem install mysql 时,我会收到以下错误消息

  bash-3.2#gem install mysql 
构建原生扩展。这可能需要一段时间...
错误:安装mysql时出错:
错误:无法构建gem本机扩展。

/ opt / local / bin / ruby​​ extconf.rb
检查mysql_ssl_set()... no
检查rb_str_set_len()... no
检查对于rb_thread_start_timer()...没有
检查mysql.h ...没有
检查mysql / mysql.h ...没有
*** extconf.rb失败***
由于某种原因无法创建Makefile,可能缺少
必需的库和/或头文件。查看mkmf.log文件以获取更多
的详细信息。您可能需要配置选项。

提供的配置选项:
--with-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 = / opt / local / bin / ruby​​
--with-mysql-config
--without-mysql-config


Gem文件将保留安装在/opt/local/lib/ruby/gems/1.8/gems/mysql-2.8.1中进行检查。
将结果记录到/opt/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out

我该如何解决这个问题?我已经使用软件包文件(.pkg)安装了32位mysql,并且我对ruby非常新颖......



更新4/26/11 5:11 pm EST
安装了RVM并更新了ruby到1.9.2
我也查看了评论中发布的链接。我做了>找到mysql_config
,结果为

  / usr /local/mysql-5.1.56-osx10.6-x86/bin/mysql_config 
/usr/local/mysql-5.1.56-osx10.6-x86/man/man1/mysql_config.1

因此,我尝试了
gem install mysql - -with-mysql-config = /usr/local/mysql-5.1.56-osx10.6-x86/bin/mysql_config
,但它仍然无法正常工作...但我收到了新的错误信息..

  /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/ mkmf.rb:368:在`try_do'中:编译器未能生成可执行文件。 (RuntimeError)
您必须先安装开发工具。 $ / b / b from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:435:in`try_link0'
from / Users / kyle /.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:440:in`try_link'
from /Users/kyle/.rvm/rubies/ruby-1.9 .2-p180 / lib / ruby​​ / 1.9.1 / mkmf.rb:552:位于/Users/kyle/.rvm/rubies-1.9.2-p180/lib/ruby/中的`try_func'
中1.9.1 / mkmf.rb:797:在`block in have_func'
from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb :693:在`block in check_for'
from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:280:in`block( 2级)推迟'
from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:254:in`open'
from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:280:in`block in postpone'
from / Users / kyle / .rvm / rubies / ruby​​-1.9.2-p180 / lib / ruby​​ / 1.9.1 / mkmf.rb:254:从/Users/kyle/.rvm/rubies/ruby-1.9开启
。 2-P180 / LIB /红宝石/ 1.9.1 / mkmf.rb:276:ⅰ从`/Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:692:in`checking_for'
从/ u`推迟'
/Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:796:in`have_func'
from extconf.rb:50:in`< ; main>'


Gem文件将保持安装在/Users/kyle/.rvm/rubies/ruby-1.9.2-p180/bin/th-mysql-config=/usr /local/mysql-5.1.56-osx10.6-x86/bin/mysql_config/gems/mysql-2.8.1进行检查。

真的很想感谢那些评论过的人......并且非常感谢能否给予更多帮助.. ...试图让darn mysql安装2天...

解决方案

通过卸载32位解决了这个问题MySQL就是在我的系统上,并安装了5.1.56 64位。

希望这有助于其他与我有同样问题的人。


I've followed the instructions on http://geryit.com/blog/2011/01/installing-mysql-with-rails-on-mac-os-x-snow-leopard/ , including the installation of ruby via macport.

Whenever I execute gem install mysql , I'll get the following error

bash-3.2# gem install mysql
Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
    ERROR: Failed to build gem native extension.

        /opt/local/bin/ruby extconf.rb
checking for mysql_ssl_set()... no
checking for rb_str_set_len()... no
checking for rb_thread_start_timer()... no
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.

Provided configuration options:
    --with-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=/opt/local/bin/ruby
    --with-mysql-config
    --without-mysql-config


Gem files will remain installed in /opt/local/lib/ruby/gems/1.8/gems/mysql-2.8.1 for inspection.
Results logged to /opt/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out

How can I resolve this issue ? I've installed the 32-bit mysql using the package file (.pkg) and also, I'm extremely new to ruby...

Update 4/26/11 5:11pm EST Installed RVM and updated ruby to 1.9.2 Also I have looked through the links posted on the comments. I did locate mysql_config and results were

/usr/local/mysql-5.1.56-osx10.6-x86/bin/mysql_config
/usr/local/mysql-5.1.56-osx10.6-x86/man/man1/mysql_config.1

Hence, I tried gem install mysql - -with-mysql-config=/usr/local/mysql-5.1.56-osx10.6-x86/bin/mysql_config but it still doesn't work... I did get new error information however..

/Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:435:in `try_link0'
    from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:440:in `try_link'
    from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:552:in `try_func'
    from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:797:in `block in have_func'
    from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking_for'
    from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels) in postpone'
    from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:254:in `open'
    from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone'
    from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:254:in `open'
    from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:276:in `postpone'
    from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for'
    from /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:796:in `have_func'
    from extconf.rb:50:in `<main>'


Gem files will remain installed in /Users/kyle/.rvm/rubies/ruby-1.9.2-p180/bin/th-mysql-config=/usr/local/mysql-5.1.56-osx10.6-x86/bin/mysql_config/gems/mysql-2.8.1 for inspection.

Really wish to thank those who commented... and really appreciate if more help can be given..... been trying to get the darn mysql installed for 2 days...

解决方案

Solved the problem by uninstalling 32-bit MySQL thats on my system.. and installed 5.1.56 64-bit.

Hope this is helpful to others who's having the same problem as me..

这篇关于gem安装mysql失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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