0

I was installing mysql2 in terminal on my mac but there was an error message. Does anyone know how to solve this problem? Thanks a lot!

my osx version is 10.9 and have installed Xcode and command line tool.

joe@~ $sudo gem install mysql2
Password:
Building native extensions.  This could take a while...
ERROR:  Error installing mysql2:
ERROR: Failed to build gem native extension.

/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/lib
-----
creating Makefile

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


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/gems/mysql2-0.3.15/ext/mysql2/gem_make.out
Adler Hsieh
  • 477
  • 3
  • 10

1 Answers1

0

The error message says, `clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future]. It seems that the option '-multiply_definedsuppress' is not currently accepted as an option by your compiler when installing it. You need to make your compiler accept it for the time being.

According to Xcode 5.1 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

Therefore, you may want to try running:

ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install mysql2
yoppuyoppu
  • 480
  • 4
  • 13