gpt4 book ai didi

Ruby Gem 在 Mavericks 和 Xcode 5.1 上安装 Json 失败 - 未知参数 : '-multiply_definedsuppress'

转载 作者:数据小太阳 更新时间:2023-10-29 06:17:56 25 4
gpt4 key购买 nike

我正在尝试运行 gem install json 并收到以下错误

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

我正在使用:

操作系统 X:10.9.2
Xcode: 5.1 构建版本 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 version 5.1 (clang-503.0.38) (基于 LLVM 3.4svn)

最佳答案

将 Xcode 更新到 5.1 后,我遇到了完全相同的问题,而且来自 Apple 的消息并不好。来自 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

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

我们看到的 clang 注释(这将是一个硬错误(不能降级为警告)在未来)对应于发行说明中宣布的更改。


要具体回答您的问题,请使用以下命令安装 json gem:

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

但是请注意,这只是临时修复。

关于Ruby Gem 在 Mavericks 和 Xcode 5.1 上安装 Json 失败 - 未知参数 : '-multiply_definedsuppress' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22352838/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com