About Mysql2-v ' 0.3.21 ' (CentOS7.3)

Source: Internet
Author: User
Tags documentation

The individual because does not install the MySQL but installs the MARIADB, therefore the network says installs the MySQL, therefore did not use, after the inspection material, the detailed situation is as follows:

Gem times wrong:

[[Email protected] ~]# gem install mysql2-v ' 0.3.21 '
Building native extensions. This could take a while ...
Error:error Installing MYSQL2:
Error:failed to build gem native extension.

Current directory:/USR/LOCAL/RVM/GEMS/RUBY-2.3.3/GEMS/MYSQL2-0.3.21/EXT/MYSQL2
/usr/local/rvm/rubies/ruby-2.3.3/bin/ruby-r./SITECONF20170824-22941-12YKOIQ.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 () ... no
Checking for RB_WAIT_FOR_SINGLE_FD () ... yes
Checking for Rb_hash_dup () ... yes
Checking for Rb_intern3 () ... yes
Checking for mysql_query () in-lmysqlclient ... no
-----
Libmysqlclient is missing. Trying again with extra runtime libraries ...
-----
Checking for main () In-lm ... yes
Checking for mysql_query () in-lmysqlclient ... no
Checking for main () In-lz ... yes
Checking for mysql_query () in-lmysqlclient ... no
Checking for main () In-lsocket ... no
Checking for main () In-lnsl ... yes
Checking for mysql_query () in-lmysqlclient ... no
Checking for main () IN-LMYGCC ... no
-----
Libmysqlclient is missing. Need to ' Apt-get install Libmysqlclient-dev ' or ' yum install Mysql-devel ', and try again.
-----
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. 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=/usr/local/rvm/rubies/ruby-2.3.3/bin/$ (Ruby_base_name)
--with-mysql-dir
--without-mysql-dir
--with-mysql-include
--without-mysql-include=${mysql-dir}/include
--with-mysql-lib
--without-mysql-lib=${mysql-dir}/lib
--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}/lib
--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-nsllib
--without-nsllib
--with-mysqlclientlib
--without-mysqlclientlib
--with-mygcclib
--without-mygcclib

Extension failed to compile, check the Mkmf.log which can is found here:

/usr/local/rvm/gems/ruby-2.3.3/extensions/x86_64-linux/2.3.0/mysql2-0.3.21/mkmf.log

Extconf failed, exit code 1

Gem files would remain installed in/usr/local/rvm/gems/ruby-2.3.3/gems/mysql2-0.3.21 for inspection.
Results logged To/usr/local/rvm/gems/ruby-2.3.3/extensions/x86_64-linux/2.3.0/mysql2-0.3.21/gem_make.out
[Email protected] admin]# gem install mysql2-v 0.3.21
Building native extensions. This could take a while ...
Error:error Installing MYSQL2:
Error:failed to build gem native extension.

Current directory:/USR/LOCAL/RVM/GEMS/RUBY-2.3.3/GEMS/MYSQL2-0.3.21/EXT/MYSQL2
/usr/local/rvm/rubies/ruby-2.3.3/bin/ruby-r./SITECONF20170824-23131-M5GY52.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 () ... no
Checking for RB_WAIT_FOR_SINGLE_FD () ... yes
Checking for Rb_hash_dup () ... yes
Checking for Rb_intern3 () ... yes
Checking for mysql_query () in-lmysqlclient ... no
-----
Libmysqlclient is missing. Trying again with extra runtime libraries ...
-----
Checking for main () In-lm ... yes
Checking for mysql_query () in-lmysqlclient ... no
Checking for main () In-lz ... yes
Checking for mysql_query () in-lmysqlclient ... no
Checking for main () In-lsocket ... no
Checking for main () In-lnsl ... yes
Checking for mysql_query () in-lmysqlclient ... no
Checking for main () IN-LMYGCC ... no
-----
Libmysqlclient is missing. Need to ' Apt-get install Libmysqlclient-dev ' or ' yum install Mysql-devel ', and try again.
-----
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. 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=/usr/local/rvm/rubies/ruby-2.3.3/bin/$ (Ruby_base_name)
--with-mysql-dir
--without-mysql-dir
--with-mysql-include
--without-mysql-include=${mysql-dir}/include
--with-mysql-lib
--without-mysql-lib=${mysql-dir}/lib
--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}/lib
--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-nsllib
--without-nsllib
--with-mysqlclientlib
--without-mysqlclientlib
--with-mygcclib
--without-mygcclib

Extension failed to compile, check the Mkmf.log which can is found here:

/usr/local/rvm/gems/ruby-2.3.3/extensions/x86_64-linux/2.3.0/mysql2-0.3.21/mkmf.log

Extconf failed, exit code 1

Gem files would remain installed in/usr/local/rvm/gems/ruby-2.3.3/gems/mysql2-0.3.21 for inspection.
Results logged To/usr/local/rvm/gems/ruby-2.3.3/extensions/x86_64-linux/2.3.0/mysql2-0.3.21/gem_make.out

The above is the content of this error (a bit long), and later saw the forum the Great God said is the lack of ' mysql-devel ' Reliance, so try:

[email protected] ~]# Yum install Mysql-devel
Loaded Plugins:fastestmirror, LangPacks
Base | 3.6 KB 00:00
Epel/x86_64/metalink | 5.2 KB 00:00
Epel | 4.3 KB 00:00
Extras | 3.4 KB 00:00
Updates | 3.4 KB 00:00
Loading mirror speeds from cached hostfile
* base:ftp.sjtu.edu.cn
* epel:mirrors.tuna.tsinghua.edu.cn
* extras:mirrors.tuna.tsinghua.edu.cn
* updates:ftp.sjtu.edu.cn
Resolving Dependencies
--Running Transaction check
---> Package mariadb-devel.x86_64 1:5.5.52-1.el7 'll be installed
--Finished Dependency Resolution

Dependencies resolved

===============================================================================
Package Arch Version Repository Size
===============================================================================
Installing:
Mariadb-devel x86_64 1:5.5.52-1.EL7 Base-K

Transaction Summary
===============================================================================
Install 1 Package

Total Download size:750 k
Installed size:3.3 M
Is this OK [y/d/n]: Y
Downloading packages:
mariadb-devel-5.5.52-1.el7.x86_64.rpm | KB 00:03
Running transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing:1:mariadb-devel-5.5.52-1.el7.x86_64 1/1
Verifying:1:mariadb-devel-5.5.52-1.el7.x86_64 1/1

Installed:
Mariadb-devel.x86_64 1:5.5.52-1.EL7

complete!
[Email protected] admin]# gem install mysql2-v 0.3.21
Building native extensions. This could take a while ...
Successfully installed mysql2-0.3.21
Parsing documentation for MYSQL2-0.3.21
Installing RI documentation for MYSQL2-0.3.21
Done installing documentation for MYSQL2 after 1 seconds
1 Gem installed

The command executes the mysql-devel, but the actual installation is Mariadb-devel

Most of the online, MariaDB is the perfect alternative to MySQL, there is no big God can take the time to guide, mysql-devel equivalent to Mariadb-devel? or MariaDB really the perfect alternative to MySQL?

About Mysql2-v ' 0.3.21 ' (CentOS7.3)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.