Ruby Gem安装Json在Mavericks和Xcode 5.1上失败 - 未知参数:'-multiply_definedsuppress' [英] Ruby Gem install Json fails on Mavericks and Xcode 5.1 - unknown argument: '-multiply_definedsuppress'

查看:129
本文介绍了Ruby Gem安装Json在Mavericks和Xcode 5.1上失败 - 未知参数:'-multiply_definedsuppress'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  Gem :: Ext :: BuildError:错误:失败建立宝石原生扩展。 

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
创建Makefile

makeDESTDIR = clean

makeDESTDIR =
编译generator.c
链接共享对象json / ext / generator.bundle
铿锵声:错误:未知参数:' - multiply_definedsuppress'[-Wunused-command-line-argument-hard-error-in-future]
clang:注意:这将是一个硬错误(不能降级为警告)在将来
make :*** [generator.bundle]错误1

失败,退出代码2

Gem文件将保留安装在/opt/boxen/repo/.bundle/ruby /2.0.0/gems/json-1.8.0进行检查。
结果记录到/opt/boxen/repo/.bundle/ruby/2.0.0/extensions/universal-darwin-13/2.0.0/json-1.8.0/gem_make.out
code>

我正在使用:

Os X:10.9.2 < br>
Xcode:5.1 Build版本5B130a

命令行工具(CLT):5.1.0.0.1.1393561416

Ruby:ruby 2.0.0p247(2013-06-27)版本号41674)[universal.x86_64-darwin13]

Ruby Gem:2.2.2

GCC:4.2.1 Apple LLVM版本5.1(clang-503.0.38)(基于LLVM 3.4svn)

解决方案

在将Xcode更新到5.1并且Apple的新闻不好之后,我遇到了完全相同的问题。从 Xcode 5.1发行说明



  • Xcode 5.1中的Apple LLVM编译器将无法识别的命令行选项视为错误。在构建Python本机扩展和Ruby Gems时,出现了这个问题,其中一些无效的编译器选项是当前指定的。


使用无效编译器选项将需要更改以删除这些选项。为了帮助缓解这种转换,编译器会暂时接受一个选项来将错误降级为警告:

-Wno-error = unused-command -line-argument-hard-error-in-future



要解决此问题,请设置ARCHFLAGS环境变量以将错误降级为警告。
$ b

ARCHFLAGS = -Wno-error = unused-command-line-argument-hard-error-in-future gem install GemName code>


似乎所有违反编译器选项的gem必须更新为使用有效选项。明确指出:将来不会支持此选项[将错误降级为警告]



我们所看到的叮声音(将来是一个严重错误(不能降级为警告))对应于在发行说明中宣布的更改。






要专门回答您的问题,请使用以下命令安装json gem: p>

ARCHFLAGS = -Wno-error = unused-command-line-argument-hard-error-in-future gem install json



但是请注意,这只是一个临时性的解决方案。


I was trying run gem install json and got the following error

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb 
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling generator.c
linking shared-object json/ext/generator.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: *** [generator.bundle] Error 1

make failed, exit code 2

Gem files will remain installed in /opt/boxen/repo/.bundle/ruby/2.0.0/gems/json-1.8.0 for inspection.
Results logged to /opt/boxen/repo/.bundle/ruby/2.0.0/extensions/universal-darwin-13/2.0.0/json-1.8.0/gem_make.out

I'm using:

Os X: 10.9.2
Xcode: 5.1 Build version 5B130a
Command Line Tools (CLT): 5.1.0.0.1.1393561416
Ruby: ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]
Ruby Gem: 2.2.2
GCC: 4.2.1 Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)

解决方案

I am encountering the exact same problem after updating Xcode to 5.1 and news from Apple aren't good. From 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

To workaround this issue, set the ARCHFLAGS environment variable to downgrade the error to a warning.

ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install GemName

It seems that all gems violating the compiler options must be updated to use valid options. It is explicitly stated that: This option [downgrading error to warning] will not be supported in the future.

The clang note we are seeing (this will be a hard error (cannot be downgraded to a warning) in the future) corresponds to the change announced in the release notes.


To answer your question specifically, use the following to install the json gem:

ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install json

Note, however, that this is only a temporary fix.

这篇关于Ruby Gem安装Json在Mavericks和Xcode 5.1上失败 - 未知参数:'-multiply_definedsuppress'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆