gpt4 book ai didi

ruby - 无法安装 pushmeup 插件

转载 作者:太空宇宙 更新时间:2023-11-03 16:01:57 24 4
gpt4 key购买 nike

我尝试为 phonegap 推送通知 (ios) 安装 pushmeup 插件。
当我运行命令 sudo gem install 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

参数:

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

最佳答案

显然 Apple 在 Mavericks 上破坏了一些东西,他们根据这个问题删除了警告标志 unused-command-line-argument-hard-error-in-future:#528

请试试这个命令:

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

它有什么作用?这会设置环境变量:ARCHFLAGS= 这会添加一个忽略警告 -Wno-error= 这是您在 mavericks 中看不到的警告 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

编辑历史

刚刚在我的机器上测试,使用相同的 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

据我所知,您没有使用 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 吗?

关于ruby - 无法安装 pushmeup 插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22666327/

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