【问题标题】:Gem unf_ext failed to build gem native extensionGem unf_ext 无法构建 gem 原生扩展
【发布时间】:2015-06-18 14:16:09
【问题描述】:

env => Mac。操作系统优胜美地。

我有一个项目使用 ruby​​ 2.1.3 。 但是当我捆绑安装时,有一个我无法修复的错误。 gem unf_ext 有问题

这是我的终端消息:

$ gem install unf_ext -v '0.0.6'
Building native extensions.  This could take a while...
ERROR:  Error installing unf_ext:
ERROR: Failed to build gem native extension.

/Users/vincent/.rvm/rubies/ruby-2.1.3/bin/ruby extconf.rb
checking for main() in -lstdc++... yes
checking for ruby/encoding.h... yes
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling unf.cc
In file included from unf.cc:1:
In file included from ./unf/normalizer.hh:4:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/vector:265:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/__bit_reference:15:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/algorithm:628:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:604:
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/iterator:341:10: fatal error: '__debug' file not found
#include <__debug>
     ^
1 error generated.
make: *** [unf.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/vincent/.rvm/gems/ruby-2.1.3/gems/unf_ext-0.0.6 for inspection.
Results logged to /Users/vincent/.rvm/gems/ruby-2.1.3/extensions/x86_64-darwin-14/2.1.0-static/unf_ext-0.0.6/gem_make.out 

我尝试 brew update 和 xcode select install 但仍然无法正常工作。 有什么建议吗?

【问题讨论】:

  • 目前在 github 上似乎是一个未解决的问题:github.com/knu/ruby-unf/issues/11
  • 非常感谢!与链接相同。我已经解决了这个问题,只需从 Apples Developer 下载页面重新安装适用于 OS X 10.10 的 Xcode 6.2 的 Command-Line-Tools commandlinetoolsosx10.10forxcode6.2.dmg。
  • 很高兴它解决了您的问题。我也将其发布为答案。

标签: ruby-on-rails ruby gem


【解决方案1】:

这是新的 xcode 工具中的一个错误。在我的情况下,它破坏了 eventmachine。有关虚拟文件和重新安装链接的答案,请参阅 Missing C++ header <__debug> after updating OSX Command Line Tools 6.3。我降级到 6.2,问题就消失了。

来源:Error installing/bundling gem unf_ext -v '0.0.6'

【讨论】:

  • 这发生在我的 Xcode 12.2 上,所以我暂时将它切换到 12.1。
猜你喜欢
  • 2015-07-20
  • 2011-05-27
  • 2010-09-07
  • 2013-06-27
  • 2016-03-08
  • 2012-07-26
  • 2014-10-25
  • 2023-03-17
相关资源
最近更新 更多