如何在Yosemite上捆绑eventechine?

时间:2014-11-21 10:23:56

标签: ruby-on-rails ruby bundler eventmachine

我们正试图在Yosemite上使用ree-1.8.7-2012.02捆绑事件机器的1.0.3版本,但我们收到以下错误。

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/Users/purinkle/.rvm/rubies/ree-1.8.7-2012.02/bin/ruby extconf.rb
checking for rb_trap_immediate in ruby.h,rubysig.h... yes
checking for rb_thread_blocking_region()... no
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_wait_for_single_fd()... no
checking for rb_enable_interrupt()... no
checking for rb_time_new()... yes
checking for sys/event.h... yes
checking for sys/queue.h... yes
creating Makefile

make
c++  -I. -I/opt/local/include -I. -I/Users/purinkle/.rvm/rubies/ree-1.8.7-2012.02/lib/ruby/1.8/i686-darwin14.0.0 -I. -DWITH_SSL -DBUILD_FOR_RUBY -DHAVE_RB_TRAP_IMMEDIATE -DHAVE_RBTRAP -DHAVE_WRITEV -DHAVE_WRITEV -DHAVE_RB_TIME_NEW -DOS_UNIX -DHAVE_SYS_EVENT_H -DHAVE_SYS_QUEUE_H -DHAVE_KQUEUE  -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 -O2 -fno-tree-dce -fno-optimize-sibling-calls  -fno-common -pipe -fno-common     -c binder.cpp
clang: error: unknown argument: '-fno-tree-dce'
make: *** [binder.o] Error 1


Gem files will remain installed in /Users/purinkle/.rvm/gems/ree-1.8.7-2012.02/gems/eventmachine-1.0.3 for inspection.
Results logged to /Users/purinkle/.rvm/gems/ree-1.8.7-2012.02/gems/eventmachine-1.0.3/ext/gem_make.out

执行gem install eventmachine -v '1.0.3'

时,我们遇到同样的错误

关于如何启动和运行我们的开发机器的任何想法?

1 个答案:

答案 0 :(得分:4)

您必须使用以下命令安装Xcode和命令行工具

xcode-select --install

此外,您必须打开Xcode并接受许可条款。

更新:如果您已从早期的OSX升级系统,则应尝试删除ree安装并重新安装。

$ rvm remove ree-1.8.7-2012.02

您必须安装gcc编译器4.2版本。

$ brew install homebrew/dupes/apple-gcc42

安装编译器后,您应该能够安装ruby和eventmachine。

$ MACOSX_DEPLOYMENT_TARGET=10.9 CC=/usr/local/bin/gcc-4.2 rvm install ree