我正在尝试在OSX Mavericks上安装sqlite3 gem,但我遇到了一个看似棘手的错误。通过Google搜索,我无法找到遇到同样问题的其他人。
基本上,当我运行gem install命令时会发生这种情况:
Building native extensions. This could take a while...
ERROR: Error installing sqlite3:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking for sqlite3.h... yes
checking for sqlite3_libversion_number() in -lsqlite3... yes
checking for rb_proc_arity()... yes
checking for rb_integer_pack()... no
checking for sqlite3_initialize()... yes
checking for sqlite3_backup_init()... yes
checking for sqlite3_column_database_name()... no
checking for sqlite3_enable_load_extension()... no
checking for sqlite3_load_extension()... no
checking for sqlite3_open_v2()... yes
checking for sqlite3_prepare_v2()... yes
checking for sqlite3_int64 in sqlite3.h... yes
checking for sqlite3_uint64 in sqlite3.h... yes
creating Makefile
make "DESTDIR="
compiling backup.c
compiling database.c
database.c:300:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
1 warning generated.
compiling exception.c
compiling sqlite3.c
compiling statement.c
linking shared-object sqlite3/sqlite3_native.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: *** [sqlite3_native.bundle] Error 1
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/sqlite3-1.3.9 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/sqlite3-1.3.9/ext/sqlite3/gem_make.out
我不知道clang是什么,但是gem似乎正在传递一个可能被弃用的论点或其他什么?任何对这些东西有更多了解的人都有任何想法吗?
答案 0 :(得分:8)
Mavericks中的新版XCode显然附带了一个编译器,可将未知的传递参数视为错误。
要解决此问题,请将环境变量设置为ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future
,以便将错误降级为警告。
所以要安装sqlite3 gem:
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install sqlite3
参考:http://bruteforce.gr/bypassing-clang-error-unknown-argument.html