【问题标题】:Error installing/bundling gem unf_ext -v '0.0.6'安装/捆绑 gem unf_ext -v '0.0.6' 时出错
【发布时间】:2015-06-15 12:59:32
【问题描述】:

我正在尝试捆绑 intall unf_ext -v '0.0.6',但我不断收到此错误:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

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 update --systembrew install coreutils,但我仍然遇到同样的错误。

更新:回答
Apple Developer 下载并安装commandlinetoolsosx10.10forxcode6.2.dmg。无需卸载任何东西。

【问题讨论】:

  • Corinne,我相信您使用的是 Mac OSX。 '未能构建 gem 原生扩展。'错误通常是由于缺少 Xcode 的命令行工具引起的。你有安装它们吗?如果没有,请从 Xcode-> Preferences-> Downloads 安装它们,或者使用 xcode-select --install 从命令行安装它们,然后重试 gem 安装。

标签: ruby-on-rails ruby gem bundle bundler


【解决方案1】:

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

【讨论】:

    【解决方案2】:

    这样做对我有用:

    echo '#define _LIBCPP_ASSERT(x, m) ((void)0)' | sudo tee -a /Library/Developer/CommandLineTools/usr/include/c++/v1/__debug > /dev/null
    

    然后再次运行bundle

    而且,由于这只是在 Apple 发布补丁之前的临时修复,请使用以下命令删除新创建的文件:

    sudo rm /Library/Developer/CommandLineTools/usr/include/c++/v1/__debug
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-11-29
      • 2016-07-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-09
      • 2011-10-14
      • 2017-09-16
      相关资源
      最近更新 更多