gem mysql2错误

时间:2014-04-19 08:50:08

标签: mysql ruby-on-rails ruby

我刚刚将我的mac升级到OS X 10.9.8。

当我谷歌这个问题时,我得到了一些解决方案。 (例如:安装Xcode,安装mysql..ect)

但是仍然无法解决这个问题。

尝试安装gem:     错误:安装mysql2时出错:         错误:无法构建gem原生扩展。

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby 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()... yes
checking for rb_wait_for_single_fd()... yes
checking for rb_hash_dup()... yes
checking for rb_intern3()... yes
-----
Using mysql_config at /usr/local/bin/mysql_config
-----
checking for mysql.h... yes
checking for errmsg.h... yes
checking for mysqld_error.h... yes
-----
Setting rpath to /usr/local/Cellar/mysql/5.6.17_1/lib
-----
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling client.c
compiling infile.c
compiling mysql2_ext.c
compiling result.c
linking shared-object mysql2/mysql2.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: *** [mysql2.bundle] Error 1

make failed, exit code 2

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/mysql2-0.3.15 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/mysql2-0.3.15/gem_make.out

解决方案是sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install mysql2

如果有人遇到同样的问题,您可以尝试ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install gem_name

0 个答案:

没有答案