ruby 2.1安装mysql2 gem 报错

来源:互联网 发布:美工审核标准 编辑:程序博客网 时间:2024/06/07 03:08
[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

0 0