gem install unf_ext -v'0.0.6'在Mountain Lion mac上失败

时间:2014-02-20 02:18:51

标签: c++ ruby-on-rails ruby macos

这是我运行bundle install

时遇到的错误
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /Users/sam/.rvm/rubies/ree-1.8.7-2012.02/bin/ruby extconf.rb 
checking for main() in -lstdc++... yes
checking for ruby/encoding.h... no
creating Makefile
CXX is automatically set to g++-4.6

make
g++-4.6  -I. -I/opt/local/include -I. -I/Users/sam/.rvm/rubies/ree-1.8.7-2012.02/lib/ruby/1.8/i686-darwin12.5.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common -g -O2 -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl098/include  -fno-common -pipe -fno-common    -c unf.cc
make: g++-4.6: No such file or directory
make: *** [unf.o] Error 1


Gem files will remain installed in /Users/sam/.rvm/gems/ree-1.8.7-2012.02@global/gems/unf_ext-0.0.6 for inspection.
Results logged to /Users/sam/.rvm/gems/ree-1.8.7-2012.02@global/gems/unf_ext-0.0.6/ext/unf_ext/gem_make.out
An error occurred while installing unf_ext (0.0.6), and Bundler cannot continue.
Make sure that `gem install unf_ext -v '0.0.6'` succeeds before bundling.

看起来缺少g ++ 4.6。

which g++会返回/usr/bin/g++,但which g++-4.6不会返回任何内容。

我确实安装了Xcode Developer Tools。我不确定该怎么做。如何才能使捆绑安装成功?

1 个答案:

答案 0 :(得分:0)

使用jruby安装正常。似乎是我正在使用的ree版本的问题。