Gem 在 Mac OS 10.10 上构筑 ruby 1.8.7 ,Rails 2.3.18 环境

seraphim_houwei · 2014年12月24日 · 最后由 chunlea 回复于 2014年12月25日 · 3082 次阅读

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

/Users/fun-mac01/.rvm/rubies/ruby-1.8.7-p374/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. -I/Users/fun-mac01/.rvm/rubies/ruby-1.8.7-p374/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 -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/fun-mac01/.rvm/gems/ruby-1.8.7-p374/gems/eventmachine-1.0.3 for inspection. Results logged to /Users/fun-mac01/.rvm/gems/ruby-1.8.7-p374/gems/eventmachine-1.0.3/ext/gem_make.out An error occurred while installing eventmachine (1.0.3), and Bundler cannot continue. Make sure that gem install eventmachine -v '1.0.3' succeeds before bundling.

以上是 执行 bundle install 的时候出的错,不知道怎么解决,各位遇见过吗?

Ruby 2.2.0 马上就要发布了,Rails 4.2.0 也已经发布了。

但是项目需要的运行环境就是 ruby 1.8.7,Rails 2.3.18 环境的,所以我也没有办法。

#2 楼 @seraphim_houwei 用 Vagrant 装个和线上一样的运行环境。

#3 楼 @Rei 呵呵,明白你的意思,是一个不错的解决办法,非常感谢。 暂时先不考虑这个,因为 这样需要跟公司要环境配置手顺,比较麻烦。 我想上面的错误信息是怎么回事?应该怎么解决呢?

环境配置手顺 日企?

装 gcc 看看,似乎是不兼容 clang

需要 登录 后方可回复, 如果你还没有账号请 注册新账号