Pregunta

I try to install pushmeup plugin for phonegap push notifications (ios).
When I run command sudo gem install pushmeup I get this error:

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

¿Fue útil?

Solución

Apparently Apple broke something on Mavericks, they removed the warning flag unused-command-line-argument-hard-error-in-future acording to this issue: #528

Please try this command:

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

what it does? this sets the environment variable: ARCHFLAGS= this adds a ignore warnings -Wno-error= and this is the warning that you don't see in mavericks unused-command-line-argument-hard-error-in-future (which should be ignored)

In 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

EDIT HISTORY

just tested on my machine, using same ruby:

$ 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

From what i saw you are not using rvm or rbenv so the problem is not in gcc dependencies

Accordingly to the output provided, the error was when installing json-1.8.1. Can you post the log located at: /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/json-1.8.1/gem_make.out ?

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top