SQLite3 gem编译错误

6
我正在尝试在OSX Mavericks上安装sqlite3 gem,但我遇到了一个看起来很棘手的错误。通过谷歌搜索,我没有找到其他人有同样的问题。
基本上,当我运行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似乎传递了一个可能已经过时的参数?对于这方面有更多知识的人有什么想法吗?


1个回答

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


这对我也解决了问题! - Tyson Cadenhead

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接