关于 mysql2 -v '0.3.21'(CentOS7.3)

个人由于没有安装mysql而是装的MariaDB,所以网上说安装mysql,故没有采用,经查阅资料后,详细情况如下:

Gem时报错:

[[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. You may 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. 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=/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

To see why this extension failed to compile, please check the mkmf.log which can be 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 will 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. You may 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. 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=/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

To see why this extension failed to compile, please check the mkmf.log which can be 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 will 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

以上是这个错误的内容(有点长),后来有看到论坛大神说是缺少 ’‘mysql-devel“ 的依赖,于是尝试:

[[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 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================
Package Arch Version Repository Size
===============================================================================
Installing:
mariadb-devel x86_64 1:5.5.52-1.el7 base 750 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 | 750 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

命令执行的是 mysql-devel,但实际情况安装的  为mariadb-devel

网上大都说,MariaDB 是Mysql 完美替代品,那有没有大神能抽空指点下,mysql-devel 等同于 Mariadb-devel ?还是  MariaDB 真的完美替代与Mysql 了?

关于 mysql2 -v '0.3.21'(CentOS7.3)

时间: 2024-10-10 13:04:31

关于 mysql2 -v '0.3.21'(CentOS7.3)的相关文章

bundle install 出现 'gem install mysql2 -v '0.3.15' succeeds before bunding '

bundle install 出现  'gem install mysql2 -v '0.3.15' succeeds before bunding ' 解决:sudo apt-get install libmysql-ruby '若找不到这个包试试下面到包 参考:http://packages.ubuntu.com/search?keywords=mysql-ruby ruby-dataobjects-mysql libmysqldb-ruby ruby-dbd-mysql sudo apt-

windows rails new demo时候出错Make sure that `gem install mysql2 -v '0.3.15'` succeeds before bundling.

rails new demo --database=mysql最后报错Gem files will remain installed in D:/BillFiles/rails_dev/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.15 for inspection.Results logged to D:/BillFiles/rails_dev/Ruby193/lib/ruby/gems/1.9.1/extensions/x86-mingw32/1.9

bundle install 出现 'gem install mysql2 -v '0.3.15' succeeds before bunding '

bundle install 出现  'gem install mysql2 -v '0.3.15' succeeds before bunding ' 解决:sudo apt-get install libmysql-ruby '如果你找不到包尝试以下的包 參考:http://packages.ubuntu.com/search?keywords=mysql-ruby ruby-dataobjects-mysql libmysqldb-ruby ruby-dbd-mysql sudo apt-

phoenix 3.1 + hbase 0.94.21 的安装和使用

Apache Phoenix 是 HBase 的 SQL 驱动.Phoenix 使得 HBase 支持通过 JDBC 的方式进行访问,并将你的 SQL 查询转成 HBase 的扫描和相应的动作. 兼容性: Phoenix 2.x - HBase 0.94.x Phoenix 3.x - HBase 0.94.x Phoenix 4.x - HBase 0.98.1+ 1:hbase 0.94.21 的安装 参考http://blog.csdn.net/wind520/article/detail

开源yYmVc项目 v 0.2 版本介绍

项目地址:https://code.csdn.net/hacke2/yymvc 本版本主要实现以下几点功能: 1.框架入口基于过滤器统一实现,action后缀动态配置 2.action配置模仿struts 3.增加action的辅助类 4.完成模型与视图的分离 ----------- 开源yYmVc项目 v 0.2 版本介绍,布布扣,bubuko.com

深入浅出JavaScript函数 v 0.5

本文的观点是建立在<JavaScript权威指南 6th Ed> <JavaScript高级编程 3th Ed> <JavaScript精粹 2th Ed>之上, 笔者将尽所能将概念.原理叙述清楚,由于笔者水平有限,理解不当之处在所难免,请读者不吝交流. 目录 1 什么是函数? 2 函数就是对象! 3 函数字面量(函数表达式) 4 函数调用 4.1 方法调用模式 4.2 函数调用模式 4.3 构造器调用模式 4.4 间接调用模式 5 函数的参数与返回值 6 扩充类型的功

C++:vector中的v.at(0)和v[0]的区别

设v是一个vector的对象, 如果v是非空的,则v.at(0)和v[0]是没有区别的,都是取数组中第一个值: 如果v是空的,则v.at(0)会抛出异常(exception std::out_of_range),指出数组下标越界,而v[0]的行为是未知的,因为operator[]操作符是不做下标越界检查的,这是为了保证程序执行效率.

dict((v[0], Student(*v))for v in data)

1 # -*- coding: utf-8 -*- 2 data = [[12202710, 'linbin', 23], [12202711, 'yanyu', 24], 3 [12202712, 'qzc', 22], [12202715, 'sxy', 23]] 4 class Student(object): 5 def __init__(self, num, name, age): 6 self.num = num 7 self.name = name 8 self.age = age

PHP (20140510)深入浅出 JavaScript 变量、作用域和内存 v 0.5

深入浅出 JavaScript 变量.作用域和内存 v 0.5 本文主要从原理入手分享变量和作用域的相关知识,最后结合本文所分享知识,再次深入了解下闭包的运行原理. 主要参考<JS高级程序设计> <JS权威指南> <高性能 JS> 三本书. 目录 1 变量 1.1 变量的声明 1.2 变量类型的特点 2 执行环境和作用域 3 再谈谈闭包 变量 对 JavaScript 稍微有点了解的同学都知道,JavaScript 中的变量与其他语言的变量有很大区别. JS 的弱类型的