无法在OS X上安装mysql gem [英] Can't install mysql gem on OS X

查看:195
本文介绍了无法在OS X上安装mysql gem的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在做一个


sudo gem install mysql


在OS X上安装mysql gem。此操作失败,并显示以下输出:


构建本机扩展。这可能需要一段时间...



错误:安装mysql时出错:



错误:



/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb



检查mysql_ssl_set()... yes



检查rb_str_set_len()...是


$ b b

检查rb_thread_start_timer()... no



检查mysql.h ... yes



创建Makefile



makeDESTDIR =clean



makeDESTDIR =



编译mysql.c



链接共享对象mysql / mysql_api.bundle



clang:error:unknown argument:'-multiply_definedsuppress'[-Wunused-command-line-> argument-hard-error-in-future]



clang:注意:这将是以后的硬错误(不能降级为警告)



make: * [mysql_api.bundle] 1



Gem文件将仍然安装在/ Library / Ruby / Gems / 2.0.0 / gems / mysql-2.9.1以供检查。



结果记录到/Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13 /2.0.0/mysql-2.9.1/gem_make.out


任何想法可能会导致什么?我有mysql安装与homebrew如果这有什么区别。

解决方案

从Apple的Xcode / Clang发行说明:


Xcode 5.1中的Apple LLVM编译器将无法识别的命令行选项视为错误。在构建Python本机扩展和Ruby Gems时已经遇到了这个问题,当前指定了一些无效的编译器选项。
需要更改使用无效编译器选项的项目以删除这些选项。为了帮助缓和转换,编译器将临时接受一个选项将错误降级为警告:



-Wno-error =命令行参数硬错误未来



ARCHFLAGS = -Wno-error =命令行参数硬错误在未来gem install GemName



I'm doing a

sudo gem install mysql

on OS X to install the mysql gem. This fails with the following output:

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

ERROR: Error installing mysql:

ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb

checking for mysql_ssl_set()... yes

checking for rb_str_set_len()... yes

checking for rb_thread_start_timer()... no

checking for mysql.h... yes

creating Makefile

make "DESTDIR=" clean

make "DESTDIR="

compiling mysql.c

linking shared-object mysql/mysql_api.bundle

clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-> argument-hard-error-in-future]

clang: note: this will be a hard error (cannot be downgraded to a warning) in the future

make: * [mysql_api.bundle] Error 1

make failed, exit code 2

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/mysql-2.9.1 for inspection.

Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/mysql-2.9.1/gem_make.out

Any idea what could be causing this? I have mysql installed with homebrew if that makes a difference.

解决方案

From Apple's Xcode/Clang release notes:

The Apple LLVM compiler in Xcode 5.1 treats unrecognized command-line options as errors. This issue has been seen when building both Python native extensions and Ruby Gems, where some invalid compiler options are currently specified. Projects using invalid compiler options will need to be changed to remove those options. To help ?ease that transition, the compiler will temporarily accept an option to downgrade the error to a warning:

-Wno-error=unused-command-line-argument-hard-error-in-future

ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install GemName

这篇关于无法在OS X上安装mysql gem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆