在OSX 10.9.2上安装oj Ruby gem的问题

时间:2014-03-13 20:10:26

标签: ruby rubygems gem

我是Ruby新手并尝试使用以下命令安装oj gem:

sudo gem install oj -v '2.1.6'

不幸的是我收到了以下错误。这是由于使用Ruby 2.0?有没有解决方法?

ERROR:  Error installing oj:
    ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
>>>>> Creating Makefile for ruby version 2.0.0 on universal.x86_64-darwin13 <<<<<
creating Makefile

make "DESTDIR="
compiling cache8.c
compiling circarray.c
compiling compat.c
compiling dump.c
dump.c:165:1: warning: unused function 'ulong2str' [-Wunused-function]
ulong2str(uint32_t num, char *end) {
^
1 warning generated.
compiling err.c
compiling fast.c
fast.c:151:1: warning: unused function 'next_white' [-Wunused-function]
next_white(ParseInfo pi) {
^
1 warning generated.
compiling hash.c
compiling hash_test.c
compiling object.c
compiling odd.c
compiling oj.c
compiling parse.c
compiling resolve.c
compiling saj.c
saj.c:130:1: warning: unused function 'next_white' [-Wunused-function]
next_white(ParseInfo pi) {
^
1 warning generated.
compiling scp.c
compiling strict.c
compiling val_stack.c
linking shared-object oj.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: *** [oj.bundle] Error 1


Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/oj-2.1.6 for inspection.

1 个答案:

答案 0 :(得分:0)

这个问题是由Xcode 5.1引起的 - 它已被报告为Ruby的错误。

https://bugs.ruby-lang.org/issues/9624#change-45736

这里还有一些额外的讨论: Ruby Gem install Json fails on Mavericks and Xcode 5.1 - unknown argument: '-multiply_definedsuppress'