Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the EventMachine gem to compile on OSX Lion 10.8.2 with Xcode 4.5.1

I looked everywhere I can find but can't seem to find a solution to this.

I'm using Xcode 4.5.1 on Lion 10.8.2, and am trying to run bundle for a Rails project and it keeps jamming up on this. I'm using the Thin gem for Heroku.

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

For now I'm having to do without Thin. Does anyone have a solution?

like image 982
jbolanos Avatar asked Oct 16 '12 06:10

jbolanos


1 Answers

Also check for a symlink:

$ sudo ln -s /usr/bin/g++ /usr/bin/g++-4.2
like image 188
Kien Pham Avatar answered Sep 21 '22 01:09

Kien Pham