mysql - 无法在 OS X 上安装 mysql gem

标签 mysql ruby macos gem clang

我在做一个

sudo gem install mysql

在 OS X 上安装 mysql gem。这失败了,输出如下:

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

知道是什么原因造成的吗?如果有什么不同的话,我已经用自制软件安装了 mysql。

最佳答案

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

关于mysql - 无法在 OS X 上安装 mysql gem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22312583/

相关文章:

ruby - 将 God 与多个应用程序一起使用,并在重新启动后自动启动它们

macos - 溢出预期/超时Mac OS X

java - vi 的内置 Java 语法文件在哪里?

c++ - 使用基于 Qt 的应用程序从 Finder 打开文件?

javascript - node.js 从 View 中查询 mysql 数据库可能吗?

mysql - Ubuntu 上的 LAMP 堆栈设置 : What is 'localhost' ?

css - Sass -- 在 Linux 上观察错误

Ruby - 从文件中读取字节,转换为整数

mysql - 如何从mysql中的单个列更新单个数据

mysql - 更新语句上的缓慢 MySQL 查询