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 關注
- 684 瀏覽
添加回答
舉報
0/150
提交
取消