RubyGemInstallJson在小牛和Xcode 5.1上失败-未知参数:‘-乘_定义抑制’我尝试运行gem安装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 Makefilemake "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 1make failed, exit code 2Gem 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我用的是:OS X:10.9.2Xcode:5.1构建版本5B130a命令行工具(CLT):5.1.0.0.1.1393561416Ruby:Ruby2.0.0p247(2013-06-27修订版41674)[General.x86_64-darwin 13]Ruby Gem:2.2.2GCC:4.2.1 Apple LLVM 5.1版(clang-503.0.38)(基于LLVM 3.4svn)
3 回答
撒科打诨
TA贡献1934条经验 获得超2个赞
Xcode 5.1中的AppleLLVM编译器将无法识别的命令行选项视为错误。在构建Python本机扩展和RubyGems(当前指定了一些无效的编译器选项)时,就发现了这个问题。
需要更改使用无效编译器选项的项目以删除这些选项。为了帮助简化转换,编译器将临时接受将错误降级为警告的选项:
-Wno-error=unused-command-line-argument-hard-error-in-future
若要解决此问题,请将ARCHFLAGS环境变量设置为将错误降级为警告。
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install GemName
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install json
- 3 回答
- 0 关注
- 647 浏览
添加回答
举报
0/150
提交
取消