brew 安装mysql5.6_MacOS 10.14安装和brew更新后无法安装mysql gem

在macOS 10.14安装Brew更新后,我的开发系统坏了.

我无法安装mysql gem.在尝试安装时,我得到:

$gem install mysql -v '2.8.1' --source 'http://rubygems.org/'

Building native extensions. This could take a while...

ERROR: Error installing mysql:

ERROR: Failed to build gem native extension.

current directory: /Users/MYACCOUNT/.rvm/gems/ruby-1.8.7-p374@WEBPROJECT/gems/mysql-2.8.1/ext/mysql_api

/Users/MYACCOUNT/.rvm/rubies/ruby-1.8.7-p374/bin/ruby -r ./siteconf20180926-49343-waujia-0.rb extconf.rb

checking for mysql_ssl_set()... yes

checking for rb_str_set_len()... yes

checking for rb_thread_start_timer()... yes

checking for mysql.h... no

checking for mysql/mysql.h... no

*** 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=/Users/MYACCOUNT/.rvm/rubies/ruby-1.8.7-p374/bin/ruby

--with-mysql-config

--without-mysql-config

To see why this extension failed to compile, please check the mkmf.log which can be found here:

/Users/MYACCOUNT/.rvm/gems/ruby-1.8.7-p374@WEBPROJECT/extensions/x86-darwin-14/1.8/mysql-2.8.1/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Users/MYACCOUNT/.rvm/gems/ruby-1.8.7-p374@WEBPROJECT/gems/mysql-2.8.1 for inspection.

Results logged to /Users/MYACCOUNT/.rvm/gems/ruby-1.8.7-p374@WEBPROJECT/extensions/x86-darwin-14/1.8/mysql-2.8.1/gem_make.out

相对mkmf.log是:

have_func: checking for mysql_ssl_set()... -------------------- yes

"/usr/local/bin/gcc-4.9 -o conftest -I. -I/Users/MYACCOUNT/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/1.8/i686-darwin14.4.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/Cellar/mysql/5.7.21/include/mysql -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl098/include -O2 -fno-tree-dce -fno-optimize-sibling-calls -fno-common -pipe -fno-common conftest.c -L. -L/Users/MYACCOUNT/.rvm/rubies/ruby-1.8.7-p374/lib -L. -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl098/lib -L/usr/local/Cellar/mysql/5.7.21/lib -lmysqlclient -lssl -lcrypto -lruby-static -L/usr/local/Cellar/mysql/5.7.21/lib -lmysqlclient -lssl -lcrypto -ldl -lobjc "

conftest.c: In function 't':

conftest.c:3:53: error: 'mysql_ssl_set' undeclared (first use in this function)

int t() { void ((*volatile p)()); p = (void ((*)()))mysql_ssl_set; return 0; }

^

conftest.c:3:53: note: each undeclared identifier is reported only once for each function it appears in

checked program was:

/* begin */

1: /*top*/

2: int main() { return 0; }

3: int t() { void ((*volatile p)()); p = (void ((*)()))mysql_ssl_set; return 0; }

/* end */

"/usr/local/bin/gcc-4.9 -o conftest -I. -I/Users/MYACCOUNT/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/1.8/i686-darwin14.4.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/Cellar/mysql/5.7.21/include/mysql -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl098/include -O2 -fno-tree-dce -fno-optimize-sibling-calls -fno-common -pipe -fno-common conftest.c -L. -L/Users/MYACCOUNT/.rvm/rubies/ruby-1.8.7-p374/lib -L. -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl098/lib -L/usr/local/Cellar/mysql/5.7.21/lib -lmysqlclient -lssl -lcrypto -lruby-static -L/usr/local/Cellar/mysql/5.7.21/lib -lmysqlclient -lssl -lcrypto -ldl -lobjc "

ld: warning: directory not found for option '-L/usr/local/opt/openssl098/lib'

checked program was:

/* begin */

1: /*top*/

2: int main() { return 0; }

3: int t() { mysql_ssl_set(); return 0; }

/* end */

--------------------

have_func: checking for rb_str_set_len()... -------------------- yes

"/usr/local/bin/gcc-4.9 -o conftest -I. -I/Users/MYACCOUNT/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/1.8/i686-darwin14.4.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/Cellar/mysql/5.7.21/include/mysql -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl098/include -O2 -fno-tree-dce -fno-optimize-sibling-calls -fno-common -pipe -fno-common conftest.c -L. -L/Users/MYACCOUNT/.rvm/rubies/ruby-1.8.7-p374/lib -L. -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl098/lib -L/usr/local/Cellar/mysql/5.7.21/lib -lmysqlclient -lssl -lcrypto -lruby-static -L/usr/local/Cellar/mysql/5.7.21/lib -lmysqlclient -lssl -lcrypto -ldl -lobjc "

conftest.c: In function 't':

conftest.c:3:53: error: 'rb_str_set_len' undeclared (first use in this function)

int t() { void ((*volatile p)()); p = (void ((*)()))rb_str_set_len; return 0; }

^

conftest.c:3:53: note: each undeclared identifier is reported only once for each function it appears in

checked program was:

/* begin */

1: /*top*/

2: int main() { return 0; }

3: int t() { void ((*volatile p)()); p = (void ((*)()))rb_str_set_len; return 0; }

/* end */

"/usr/local/bin/gcc-4.9 -o conftest -I. -I/Users/MYACCOUNT/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/1.8/i686-darwin14.4.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/Cellar/mysql/5.7.21/include/mysql -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl098/include -O2 -fno-tree-dce -fno-optimize-sibling-calls -fno-common -pipe -fno-common conftest.c -L. -L/Users/MYACCOUNT/.rvm/rubies/ruby-1.8.7-p374/lib -L. -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl098/lib -L/usr/local/Cellar/mysql/5.7.21/lib -lmysqlclient -lssl -lcrypto -lruby-static -L/usr/local/Cellar/mysql/5.7.21/lib -lmysqlclient -lssl -lcrypto -ldl -lobjc "

ld: warning: directory not found for option '-L/usr/local/opt/openssl098/lib'

checked program was:

/* begin */

1: /*top*/

2: int main() { return 0; }

3: int t() { rb_str_set_len(); return 0; }

/* end */

--------------------

have_func: checking for rb_thread_start_timer()... -------------------- yes

"/usr/local/bin/gcc-4.9 -o conftest -I. -I/Users/MYACCOUNT/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/1.8/i686-darwin14.4.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/Cellar/mysql/5.7.21/include/mysql -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl098/include -O2 -fno-tree-dce -fno-optimize-sibling-calls -fno-common -pipe -fno-common conftest.c -L. -L/Users/MYACCOUNT/.rvm/rubies/ruby-1.8.7-p374/lib -L. -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl098/lib -L/usr/local/Cellar/mysql/5.7.21/lib -lmysqlclient -lssl -lcrypto -lruby-static -L/usr/local/Cellar/mysql/5.7.21/lib -lmysqlclient -lssl -lcrypto -ldl -lobjc "

conftest.c: In function 't':

conftest.c:3:53: error: 'rb_thread_start_timer' undeclared (first use in this function)

int t() { void ((*volatile p)()); p = (void ((*)()))rb_thread_start_timer; return 0; }

^

conftest.c:3:53: note: each undeclared identifier is reported only once for each function it appears in

checked program was:

/* begin */

1: /*top*/

2: int main() { return 0; }

3: int t() { void ((*volatile p)()); p = (void ((*)()))rb_thread_start_timer; return 0; }

/* end */

"/usr/local/bin/gcc-4.9 -o conftest -I. -I/Users/MYACCOUNT/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/1.8/i686-darwin14.4.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/Cellar/mysql/5.7.21/include/mysql -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl098/include -O2 -fno-tree-dce -fno-optimize-sibling-calls -fno-common -pipe -fno-common conftest.c -L. -L/Users/MYACCOUNT/.rvm/rubies/ruby-1.8.7-p374/lib -L. -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl098/lib -L/usr/local/Cellar/mysql/5.7.21/lib -lmysqlclient -lssl -lcrypto -lruby-static -L/usr/local/Cellar/mysql/5.7.21/lib -lmysqlclient -lssl -lcrypto -ldl -lobjc "

ld: warning: directory not found for option '-L/usr/local/opt/openssl098/lib'

checked program was:

/* begin */

1: /*top*/

2: int main() { return 0; }

3: int t() { rb_thread_start_timer(); return 0; }

/* end */

--------------------

have_header: checking for mysql.h... -------------------- no

"/usr/local/bin/gcc-4.9 -E -I. -I/Users/MYACCOUNT/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/1.8/i686-darwin14.4.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/Cellar/mysql/5.7.21/include/mysql -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl098/include -O2 -fno-tree-dce -fno-optimize-sibling-calls -fno-common -pipe -fno-common conftest.c -o conftest.i"

In file included from conftest.c:1:0:

/usr/local/Cellar/mysql/5.7.21/include/mysql/mysql.h:35:23: fatal error: sys/types.h: No such file or directory

#include

^

compilation terminated.

checked program was:

/* begin */

1: #include

/* end */

--------------------

have_header: checking for mysql/mysql.h... -------------------- no

"/usr/local/bin/gcc-4.9 -E -I. -I/Users/MYACCOUNT/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/1.8/i686-darwin14.4.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/Cellar/mysql/5.7.21/include/mysql -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl098/include -O2 -fno-tree-dce -fno-optimize-sibling-calls -fno-common -pipe -fno-common conftest.c -o conftest.i"

In file included from conftest.c:1:0:

/usr/local/include/mysql/mysql.h:35:23: fatal error: sys/types.h: No such file or directory

#include

^

compilation terminated.

checked program was:

/* begin */

1: #include

/* end */

--------------------

我通过Brew安装了mysql并保持mysql,mysql @ 5.6或mysql@5.7有效.路径在.bash_profile中设置:

### Customize path for MYSQL

MYSQL=/usr/local/mysql/bin

export PATH=$PATH:$MYSQL

export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH

当我切换到mysql@5.6或5.7时,我相应地改变了路径.

一般来说,mysql似乎存在一些问题.

当Ruby 1.8.7中的一个webapp,运行mysql数据库的Rails 3.2.5时,另外两个具有相同技术堆栈的webapp无法重新安装mysql gem或连接到数据库.

$rake db:migrate --trace

** Invoke db:migrate (first_time)

** Invoke environment (first_time)

** Execute environment

rake aborted!

Mysql::Error: Table 'dev_WEBPROJECT.safts' doesn't exist: SHOW FULL FIELDS FROM `safts`

/Users/MYACCOUNT/.rvm/gems/ruby-1.8.7-p374@WEBPROJECT/gems/activerecord-3.2.5/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:243:in `query'

/Users/MYACCOUNT/.rvm/gems/ruby-1.8.7-p374@WEBPROJECT/gems/activerecord-3.2.5/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:243:in `execute'

/Users/MYACCOUNT/.rvm/gems/ruby-1.8.7-p374@WEBPROJECT/gems/activerecord-3.2.5/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `log'

.

.

.

/Users/MYACCOUNT/.rvm/gems/ruby-1.8.7-p374@WEBPROJECT/gems/rake-0.9.6/lib/rake/application.rb:70:in `run'

/Users/MYACCOUNT/.rvm/gems/ruby-1.8.7-p374@WEBPROJECT/gems/rake-0.9.6/bin/rake:37

/Users/MYACCOUNT/.rvm/gems/ruby-1.8.7-p374@WEBPROJECT/bin/rake:22:in `load'

/Users/MYACCOUNT/.rvm/gems/ruby-1.8.7-p374@WEBPROJECT/bin/rake:22

/Users/MYACCOUNT/.rvm/gems/ruby-1.8.7-p374@WEBPROJECT/bin/ruby_executable_hooks:15

Tasks: TOP => db:migrate => environment

有人可以帮忙吗?

解决方法:

Mojave更改了编译C扩展所需的头文件的位置.您可能需要运行以下命令来安装mysql gem:

sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

https://www.icode9.com/content-2-417651.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/556588.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Springboot中@ComponentScan 注解

三个点: 1、工程中Application类的位置。默认情况下就不需要配置ComponentScan这个注解了。 因为Application类,在启动的时候,默认是加载和Application类所在同一个目录下的所有类,包括所有子目录下的类。所以一般情况下&#xff…

在react里写原生js_小程序原生开发与第三方框架选择

最近正在更新《微信小程序入门与实践》一书的第二版。书中有一章节谈到了”多样化的小程序开发“,摘取并加以整理分享给各位开发者。我一向不推荐也不提倡公众号阅读学习编程,文章更多的是列出小程序如今多样化的框架选择,并简单剖析它们之间…

springboot中service层注入的是实现类,但Controller层接收的是接口

我们习惯这样编写代码: 在service层写接口,然后用实现类去实现接口,并且将实现类注入到容器中 Service public class AccountServiceImpl implements AccountService {}在controller层却是用接口操作service的bean的方法, Auto…

mysql data transfer_MySQL主从同步加速 Transfer-- FAQ

Q: Transfer是什么A: 是一个解决MySQL原生主从同步延迟的方案。 Transfer本身是一个在MySQL源码上打的patch,可以用于当Slave,也可以用于当第三方工具,将Master的数据同步发给Slave。 利用多线程实现主从无延迟。Q: Transfer目前的发布形式&a…

springboot整合mybatisplus中@Mapper与@MapperScan的使用

一、Mapper与MapperScan不可同时使用 二、Mapper用于注解单个mapper接口 三、Mapper Scan用于批量注解Mapper接口 四、Mapper不起作用时,因为缺少下图中的依赖包 以上为自己整合框架中遇到的问题与解决方案,如果以上解决方案不能解决您的问题&#x…

html列表按时间排序代码_按字母顺序排序的列表

有时候你需要自制一份课件PPT或者手写笔记的关键词索引,用来开卷考试查阅PPT或者复习查阅笔记时能快速定位查阅内容位置,这时你可能想要一个按字母顺序排序的列表来帮助构建需要的索引。LaTeX自身的index本身并不支持这样的功能,修改起来也颇…

@MapperScan和@ComponentScan使用问题

报错如下 原因:当MapperScan和ComponentScan一起使用时,项目启动时扫描包会发生冲突,找不到swagger配置类的包和mapper接口的包 解决办法:MapperScan和ComponentScan可以一起使用。 改为MapperScan(basePackages {}…

C语言中CY位什么时候才能为1_你真的了解C语言中的整型吗?

整型数据类型1. 整型数据类型在上一节当中,我们遇到了整型(integer)int,用来表示一个整数的数据类型。下面呢我们来讨论一下C语言里面的整数数据类型。看到这里你可能想问,一个整数而已,为什么会需要定义这么多的类型出来呢?要知…

python2中xrange比range优点_【Python面试】 说说Python中xrange和range的区别?

公众号新增加了一个栏目,就是每天给大家解答一道Python常见的面试题,反正每天不贪多,一天一题,正好合适,只希望这个面试栏目,给那些正在准备面试的同学,提供一点点帮助!小猿会从最基…

Spring的两种动态代理:Jdk和Cglib 的区别和实现

Spring的两种动态代理:Jdk和Cglib 的区别和实现 一、原理区别: java动态代理是利用反射机制生成一个实现代理接口的匿名类,在调用具体方法前调用InvokeHandler来处理。 而cglib动态代理是利用asm开源包,对代理对象类的class文件…

python语言程序设计难不难_零基础学Python编程开发难度大吗?从哪学起?

转行零基础学Python编程开发难度大吗?从哪学起? 近期很多小伙伴问我,如果自己转行学习Python,完全0基础能否学会呢?Python的难度到底有多大? 今天,小编就来为大家详细解读一下这个问题。 Python…

red6.4 mysql_rhel6.4 yum本地yum源配置

rhel6.4 yum本地yum源配置 在安装rpm包时,总是会碰到关联的包,在安装过程中带来很多麻烦,配置yum源,自关联包安装,简单省事。配置步骤:1:mount -o loop 挂载镜像盘2:编辑rhel…

Cglib和jdk动态代理的区别

Cglib和jdk动态代理的区别 动态代理解决了方法之间的紧耦合, IOC解决了类与类之间的紧耦合! Cglib和jdk动态代理的区别? 1、Jdk动态代理:利用拦截器(必须实现InvocationHandler)加上反射机制生成一个代…

python怎么判断输入的是不是数字_如何在PYTHON里判断字符串是否为数字

1 打开JUPYTER NOTEBOOK,新建一个空白的PY文档。2 str1 "888" print(str1.isdecimal()) print(str1.isdigit()) print(str1.isnumeric()) 这是正常的整数,三种方法都是可以判断。3 str2 "二" print(str2.isdecimal()) print(str2.…

在springBoot中使用Mapper类问题_@Mapper_@MapperScan_xml文件跟mapper分开_xml文件跟mapper在同一个目录下

文章目录背景xml文件跟mapper分开application.properties方式一: 主程序中MapperScan方式二: 每个接口添加Mapper注意点xml文件跟mapper在同一个目录下SpringBoot中关于Mapper 和 Repository 的一些疑问1. Mapper2. Repository3. MapperScan(“com.xxx.x…

上海交大python答案_上海交通大学python期末考试样题加解析

上海交通大学python期末考试样题加解析 一、选择题: 将唯一正确的选项写在题前括号中.每题2 分. 【 】(1) 本课程的目标定位是什么? [A] 学习Python 语言 [B] 学习计算机的工作原理 [C] 学习各种算法 [D] 学习用计算机解决问题 【 】(2) 下列哪个标识符是合法的? [A] var-nam…

python提供两种基本循环结构_Python中的循环结构

Python主要有for循环和while循环两种形式的循环结构,多个循环可以嵌套使用,并且还经常和选择结构嵌套使用。while循环一般用于循环次数难以提前确定的情况,当然也可以用于循环次数确定的情况;for循环一般用于循环次数可以提前确定…

hbase1.1.1 连接集群_Hadoop2.7.1+Hbase1.1.2集群环境搭建(10) hadoop hbase kerberos

1.hadoop安全机制历史在Hadoop1.0.0或者CDH3 版本之前, hadoop并不存在安全认证一说。默认集群内所有的节点都是可靠的,值得信赖的。用户与HDFS或者M/R进行交互时并不需要进行验证。导致存在恶意用户伪装成真正的用户或者服务器入侵到hadoop集群上&#…

SSM框架中mapper和mapping.xml文件在同一个包下需要的配置

前言 当我们在开发过程中,由于maven项目本身的限制,我们不能直接把我们的mapper.xml文件和对应mapper.java接口文件放到一起,也就是不能直接放在java包中,如图: 因为maven项目在构建打包时,会从src/main…

python处理txt文件_python处理txt文件

# coding:utf-8 # 每行求和 def addEachLine(line): values line.split() values [int(v) for v in values if v.strip()] return sum(values) def main(): result [] with open("input.txt") as f: buf f.read() lines buf.splitlines() lines [l for l in li…