我四处寻找可以找到的解决方案,但似乎找不到解决方案。
我在Lion 10.8.2上使用Xcode 4.5.1,并试图为Rails项目运行bundle
,但它一直在阻塞。我正在为Heroku使用Thin宝石。
Bolanos@Jeremys-Mac-mini ⦿-1.9.3 fishfarm $ sudo gem install eventmachine
Password:
Building native extensions. This could take a while...
ERROR: Error installing eventmachine:
ERROR: Failed to build gem native extension.
/Users/Bolanos/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... yes
checking for inotify_init() in sys/inotify.h... no
checking for __NR_inotify_init in sys/syscall.h... no
checking for writev() in sys/uio.h... yes
checking for rb_thread_check_ints()... yes
checking for rb_time_new()... yes
checking for sys/event.h... yes
checking for sys/queue.h... yes
creating Makefile
make
compiling binder.cpp
make: g++-4.2: No such file or directory
make: *** [binder.o] Error 1
Gem files will remain installed in /Users/Bolanos/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/gems/1.9.1/gems/eventmachine-1.0.0 for inspection.
Results logged to /Users/Bolanos/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/gems/1.9.1/gems/eventmachine-1.0.0/ext/gem_make.out
目前,我必须没有Thin。有人有解决方案吗?
您必须从developer.apple.com安装命令行工具包。
而且我在MacOSX10.6.sdk上也遇到了麻烦,因为那里缺少一些标题,所以我安装了MacOSX10.5.sdk,并且一切正常。
也请检查符号链接:
$ sudo ln -s / usr / bin / g ++ / usr / bin / g ++-4.2
我有确切的错误,为丢失的资源/usr/bin/g++-4.2
创建一个新的符号链接对我来说很有效。
在我的设置中,我指向地窖中的位置:
/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/g++-4.2
如果上述任何一项都不适合您,我会做的
sudo ln -s /usr/bin/llvm-g++-4.2 /usr/bin/g++-4.2
而且它就像一种魅力。运行OS X 10.8.2。
您应该同时拥有:
1)Xcode命令行工具。安装的详细说明是here。
2)Apple-gcc *编译器。我应该提到用gcc48和gcc49编译失败。因此,安装apple-gcc42(如果没有)并通过MacPorts选择编译器将解决此问题。您可以使用以下方式查看已安装的gcc版本:
port select --list gcc
您应该看到类似这样的内容,其中“ mp-”代表MacPorts自己的端口:
Available versions for gcc:
apple-gcc42 (active)
current_saved
mp-gcc48
mp-gcc49
如果没有“ apple-gcc *”,则可以通过以下方式安装:
port install apple-gcc42
之后选择了编译器:
port select --set gcc apple-gcc42
现在您可以运行:
gem install eventmachine
这应该解决在OSX上构建gem本机扩展时出现的错误的问题
我决定删除我的应用程序,然后从git重新开始,它可以正常工作-从来没有发现一个应用程序不能工作。