【发布时间】: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 --system 和 brew 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