任何人在OSX Lion中安装bson_ext gem时遇到问题

时间:2011-10-18 20:10:58

标签: ruby-on-rails-3 macos mongoid

OSX Lion,Xcode 4.2,GCC 4.2

安装bson_ext 1.4.1

时出现以下错误
Building native extensions.  This could take a while...
ERROR:  Error installing bson_ext:
ERROR: Failed to build gem native extension.

/Users/user/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb
checking for asprintf()... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

4 个答案:

答案 0 :(得分:2)

我刚碰到这个。你应该查看mkmf.log文件。可能是,它正在寻找GCC在错误的地方。我必须:

cd /usr/bin
sudo ln -s i686-apple-darwin11-llvm-gcc-4.2 i686-apple-darwin11-gcc-4.2.1

一切都很好。

答案 1 :(得分:1)

接受的答案对我不起作用。但是这样做了。

我正在使用:

  • OS X 10.8.2
  • Xcode 4.6(使用命令行工具)
  • bson_ext 1.8.2

cd /usr/bin && sudo ln -s ./gcc gcc-4.2

$ gem install bson_ext -v 1.8.2
Building native extensions.  This could take a while...
Successfully installed bson_ext-1.8.2
1 gem installed
Installing ri documentation for bson_ext-1.8.2...
Installing RDoc documentation for bson_ext-1.8.2...

答案 2 :(得分:0)

因此重新安装OSX Lion解决了这个问题。我想首先卸载xcode 4.1搞砸了我的开发人员工具安装。

感谢您的帮助。

答案 3 :(得分:0)

除了开发人员工具二进制文件之外,我不使用XCode,所以我只是卸载了XCode:

sudo /Developer/Library/uninstall-devtools –mode=all

然后安装了这个:

https://github.com/kennethreitz/osx-gcc-installer

修正了问题,我保存了一些高清空间来启动。

相关问题