Ruby on rails EventMachine:未能生成gem本机扩展

Ruby on rails EventMachine:未能生成gem本机扩展,ruby-on-rails,ruby,gcc,bundler,eventmachine,Ruby On Rails,Ruby,Gcc,Bundler,Eventmachine,我正在尝试安装eventmachine: sudo gem install eventmachine ... Building native extensions. This could take a while... /Users/kuankuan/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/rubygems/ext/builder.rb:48: warning: Insecure world writable dir /usr/local/bi

我正在尝试安装eventmachine:

sudo gem install eventmachine

...

Building native extensions.  This could take a while...
/Users/kuankuan/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/rubygems/ext/builder.rb:48: warning: Insecure world writable dir /usr/local/bin/g4bin in PATH, mode 040777
ERROR:  Error installing eventmachine:
    ERROR: Failed to build gem native extension.

        /Users/kuankuan/.rvm/rubies/ruby-1.9.3-p327/bin/ruby extconf.rb
/Users/kuankuan/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/mkmf.rb:1344: warning: Insecure world writable dir /usr/local/bin/g4bin in PATH, mode 040777
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
cc1plus: error: unrecognized command line option "-arch"
make: *** [binder.o] Error 1
站台:

Mac OSX 10.8.3
Ruby 1.9.3p327 (2012-11-10) [x86_64-darwin12.2.0]
cc--版本

Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
Target: x86_64-apple-darwin12.3.0
Thread model: posix
gcc (MacPorts gcc44 4.4.7_6) 4.4.7
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
g++ (MacPorts gcc44 4.4.7_6) 4.4.7
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
gcc——版本

Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
Target: x86_64-apple-darwin12.3.0
Thread model: posix
gcc (MacPorts gcc44 4.4.7_6) 4.4.7
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
g++ (MacPorts gcc44 4.4.7_6) 4.4.7
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
g++--版本

Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
Target: x86_64-apple-darwin12.3.0
Thread model: posix
gcc (MacPorts gcc44 4.4.7_6) 4.4.7
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
g++ (MacPorts gcc44 4.4.7_6) 4.4.7
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
命令行工具

并且,我尝试更改bundle的配置:

sudo bundle config build.eventmachine --with-cflags=\"-O2 -pipe -march=native -w\"    

嗯,看起来您需要从bin dir中删除
write
权限:

chmod 755/usr/local/bin/g4bin

这意味着除非您是
root
,否则无法写入该目录,但无论如何都不应该这样做

关于无法识别的“-arch”选项,我认为它是一种apple
gcc
扩展,因此您可能需要使用apple提供的特定gcc