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
brew 安装mysql5.6_MacOS 10.14安装和brew更新后无法安装mysql gem相关推荐
- 黑苹果安装教程 (Mojave 10.14.5) ThinkPad T450
黑苹果安装教程 (Mojave 10.14.5) 记一次我的黑苹果安装教程,本教程适用于ThinkPad T450 傻瓜式教学 准备工作 准备工具 U盘大于8G U盘大小不限做PE盘 etcher E ...
- mysql 安全配置 centos_CentOS下安装MySQL5.6.10和安全配置教程详解
注:以下所有操作都在CentOS 6.5 x86_64位系统下完成. #准备工作# 在安装MySQL之前,请确保已经使用yum安装了以下各类基础组件(如果系统已自带,还可以考虑yum update下基 ...
- t430折腾安装os majave 10.14
家里有一台废弃的T430,闲着也没怎么用,顶多重新装一个win 10了,不过看到网上有人黑mac也就顺便试试了. 第一次,试10.14.5: 失败 采用了两种方式: 第一种是直接写U盘后安装失败: 第 ...
- Centos6.4下安装mysql5.6.10
今天下午捣腾安装mysql和apache.从网上下载mysql5.6.10,http://ishare.iask.sina.com.cn/f/36050990.html,解压后发现没有configur ...
- MySQL安装 MySQL5.7.10免安装版配置,mysql5.7.10免安装版
MySQL5.7.10免安装版配置,mysql5.7.10免安装版 最新版的 Mysql 不提供图形界面的安装了, 下载下来是一个压缩包的形式, 那么我们如何来使用它呢, 让它为我们工作呢? 环境: ...
- AMD锐龙Ryzen CPU系列安装黑苹果MacOS 10.14 Mojave安装教程
教程 还有一个教程是Vanilla这个是傻瓜式的需要联网安装不过不支持32位软件这个就不多说了下面有链接自己去研究吧 https://github.com/AMD-OSX/AMD_Vanilla 另一 ...
- VMware 15 安装 Mac os 10.14
准备工具 这个还是提前说一下,重要!!!个人建议用镜像不要用 iso 格式的镜像文件,直接使用懒人版 cdr 格式的镜像 VMware 15 pro 虚拟机 unlocker302 mac os ...
- 在32位Win7下安装MySQL5.7.10安装配置过程
MySQL的安装配置过程很多人都写过,拼凑起来也非常实用.现在将我自己碎片化的安装配置过程写下来,作为自己的一个经验累积. 我在本地安装的是MySQL5.7.10版本. MySQL5.7.10的安装配 ...
- windows安装包安装mysql5.7_Windows server 2008 r2上安装MySQL5.7.10步骤
用MSI安装包安装 根据自己的操作系统下载对应的32位或64位安装包.按如下步骤操作: 第一步:安装许可 双击安装文件,在如下图所示界面中勾选"I accept the license te ...
最新文章
- JavaScript的使用
- 交通优化需求下 智能交通已达千亿市场
- UML之交互图(协作图和顺序图)
- c语言中指针中 - 和 。的区别?
- Spring/Spring Boot微服务项目 集成Druid 实现监控功能
- C#使用读写锁三行代码简单解决多线程并发写入文件时线程同步的问题
- python学习笔记(一)基本数据类型
- 深度学习之基于GAN实现手写数字生成
- 数学老师出的谜语,语文老师已哭晕在厕所!
- 深度学习之Batch Normalization
- python模块的函数_python模块内置函数
- PHP结合HTML5使用FormData对象提交表单及上传图片
- php生成随机密码的几种方法
- Web开发与设计之Google兵器谱-Web开发与设计利器
- aver函数C语言怎么用,C语言函数使用
- ScheduledExecutor定时器
- 【Oracle学习】archivelog
- 记事本新建一个html文件,怎样使用记事本建立新文件 怎么在电脑中新建一个记事本 啊?...
- 联想怎么启动windows无线服务器,Windows7系统下开启无线的多种方法
- RPG Maker mv框架代码解析之窗口图片显示
热门文章
- datasnap xe连接池_DataSnap 连接池
- ai逻辑回归_人工智能中的逻辑是什么?
- Photoshop CS3 ICO 图标保存插件
- python使用python-barcode生成任意长度字符串的条形码(一维码)详细教程
- CV2 puttext不能显示中文问题
- [深入学习C#]LINQ查询表达式详解(2)——查询表达式的转换
- where is null mysql_SQL中WHERE变量IS NULL条件导致全表扫描问题的解决方法
- php页面不断弹出值_电脑自动弹出网页怎么办
- telnet服务下载 Linux,linux telnet服务安装包
- 基于jmx监控kafka_0542-6.1.0-非安全环境下Kafka管理工具Kafka Eagle安装使用