2014-03-26 228 views
2

我嘗試安裝pushmeup插件用於電話推送通知(ios)。
當我運行命令sudo的創業板安裝pushmeup我得到這個錯誤:無法安裝pushmeup插件

Building native extensions. This could take a while... ERROR: Error installing pushmeup: 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 /Library/Ruby/Gems/2.0.0/gems/json-1.8.1 for inspection. Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/json-1.8.1/gem_make.out

GitHub上:

https://github.com/phonegap-build/PushPlugin

PARAMS:

ruby -v ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]

gem -v 2.2.2

Mac OS X v 10.9.2

XCode Version 5.1 (5B130a)

cordova -v 3.4.0-0.1.3

+0

[Ruby Gem install Json在Mavericks和Xcode 5.1上失敗 - 未知參數:'-multiply \ _definedsuppress'](http://stackoverflow.com/questions/22352838/ruby-gem-install-json-fails -on-mavericks-and-xcode-5-1-unknown-argument-mul) – Nakilon

回答

2

顯然,蘋果打破了東西在馬vericks,他們取消了警告標誌unused-command-line-argument-hard-error-in-future acording這個問題:#528

請嘗試以下命令:

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

它做什麼?這種設置環境變量:ARCHFLAGS=這增加了忽略警告-Wno-error=這是你沒有在小牛unused-command-line-argument-hard-error-in-future(應忽略)

看到Apple documentation警告:

Compiler

As of Apple LLVM compiler version 5.1 (clang-502) and later, the optimization level -O4 no longer implies link time optimization (LTO). In order to build with LTO explicitly use the -flto option in addition to the optimization level flag. (15633276) 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

Note: This option will not be supported in the future. To workaround this issue, set the ARCHFLAGS environment variable to downgrade the error to a warning. For example, you can install a Python native extension with:

$ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future easy_install ExtensionName

Similarly, you can install a Ruby Gem with:

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

編輯歷史

只是測試我的機器上,使用相同的紅寶石:

$ gem install pushmeup 
Fetching: pushmeup-0.1.2.gem (100%) 
Successfully installed pushmeup-0.1.2 
Parsing documentation for pushmeup-0.1.2 
Installing ri documentation for pushmeup-0.1.2 
Done installing documentation for pushmeup after 1 seconds 
1 gem installed 

從我看到你沒有使用rvmrbenv所以這個問題是不是在gcc依賴

因此所提供的輸出,錯誤安裝json-1.8.1時進行。 你可以發佈日誌位於:/Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/json-1.8.1/gem_make.out

+0

sh-3.2#cat /Library/Ruby/Gems/2.0.0/gems/json-1.8.1/ext/json/ext/發生器/ gem_make.out /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb 創建生成文件 使 「DESTDIR =」 編譯generator.c 鏈接共享對象JSON /ext/generator.bundle clang:錯誤:未知參數:'-multiply_definedsuppress'[-Wunused-command-line-argument-hard-error-in-future] 鏗鏘:注意:這將是一個硬錯誤(不能降級爲警告)在未來 作出:*** [generator.bundle]錯誤1 – levon

+0

我已編輯答案,請看看 –

+0

謝謝很合拍!!!!你的答案幫助了我! – levon