ruby 2.1安装mysql2 gem 报错

[root@CNSZ141384 tmp]# /opt/chef/embedded/bin/gem install mysql2-0.3.17.gem -l
Building native extensions.  This could take a while...
ERROR:  Error installing mysql2-0.3.17.gem:
ERROR: Failed to build gem native extension.


    /opt/chef/embedded/bin/ruby -r ./siteconf20160217-20268-oxedau.rb extconf.rb
checking for ruby/thread.h... yes
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
checking for rb_hash_dup()... yes
checking for rb_intern3()... yes
-----
Using mysql_config at /usr/bin/mysql_config
-----
checking for mysql.h... yes
checking for errmsg.h... yes
checking for mysqld_error.h... yes
-----
Setting libpath to /usr/lib64
-----
creating Makefile


make "DESTDIR=" clean


make "DESTDIR="
compiling result.c
compiling mysql2_ext.c
compiling client.c
compiling infile.c
linking shared-object mysql2/mysql2.so
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
make: *** [mysql2.so] Error 1


make failed, exit code 2


Gem files will remain installed in /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/mysql2-0.3.17 for inspection.

Results logged to /opt/chef/embedded/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0/mysql2-0.3.17/gem_make.out



解决方法:是因为本机没有安装:MySQL-shared-5.6.21-1.el6.x86_64.rpm

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值