微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用ruby 2.0的Mysql 2.9.1错误

OS Ubuntu 12.04.
我从https://github.com/rails/rails.git克隆了rails4.0.0beta1.
我有ruby 2.0.0p0(2013-02-24修订版39474),当我尝试“捆绑安装”时,我有以下错误消息:

Installing MysqL (2.9.1) 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /home/zergood/.rvm/rubies/ruby-2.0.0-p0/bin/ruby extconf.rb 
checking for MysqL_query()... -lMysqLclient
checking for main() in -lm... yes
checking for MysqL_query()... -lMysqLclient
checking for main() in -lz... yes
checking for MysqL_query()... -lMysqLclient
checking for main() in -lsocket... no
checking for MysqL_query()... -lMysqLclient
checking for main() in -lnsl... yes
checking for MysqL_query()... -lMysqLclient
checking for main() in -lmygcc... no
checking for MysqL_query()... -lMysqLclient
*** 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=/home/zergood/.rvm/rubies/ruby-2.0.0-p0/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}/
    --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 /home/zergood/.rvm/gems/ruby-2.0.0-p0/gems/MysqL-2.9.1 for inspection.
Results logged to /home/zergood/.rvm/gems/ruby-2.0.0-p0/gems/MysqL-2.9.1/ext/MysqL_api/gem_make.out

An error occurred while installing MysqL (2.9.1), and Bundler cannot continue.
Make sure that `gem install MysqL -v '2.9.1'` succeeds before bundling.

我该如何解决

解决方法:

所以,尝试类似的东西

sudo apt-get install libMysqL-ruby libMysqLclient-dev MysqL-server \
MysqL-client MysqL-common

然后

gem install MysqL

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐