我搜索了这个问题并不断寻找与 PC 相关的资源。
每次我尝试安装 EventMachine 时都会收到此错误:
Building native extensions. This
could take a while... ERROR: Error
installing eventmachine: ERROR:
Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for rb_trap_immediate in
ruby.h,rubysig.h... *** extconf.rb
failed *** Could not create Makefile
due to some reason, probably lack of
necessary libraries and/or headers.
Check the mkmf.log file for more
details. You may need configuration
options.
Provided configuration options:
--with-opt-dir --without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog --without-make-prog
--srcdir=. --curdir
--ruby=/usr/local/bin/ruby
/usr/local/lib/ruby/1.9.1/mkmf.rb:368:in
`try_do': The complier failed to
generate an executable file.
(RuntimeError) You have to install
development tools first. from
/usr/local/lib/ruby/1.9.1/mkmf.rb:446:in
`try_compile' from
/usr/local/lib/ruby/1.9.1/mkmf.rb:568:in
`try_var' from
/usr/local/lib/ruby/1.9.1/mkmf.rb:816:in
`block in have_var' from
/usr/local/lib/ruby/1.9.1/mkmf.rb:693:in
`block in checking_for' from
/usr/local/lib/ruby/1.9.1/mkmf.rb:280:in
`block (2 levels) in postpone' from
/usr/local/lib/ruby/1.9.1/mkmf.rb:254:in
`open' from
/usr/local/lib/ruby/1.9.1/mkmf.rb:280:in
`block in postpone' from
/usr/local/lib/ruby/1.9.1/mkmf.rb:254:in
`open' from
/usr/local/lib/ruby/1.9.1/mkmf.rb:276:in
`postpone' from
/usr/local/lib/ruby/1.9.1/mkmf.rb:692:in
`checking_for' from
/usr/local/lib/ruby/1.9.1/mkmf.rb:815:in
`have_var' from extconf.rb:16:in
`<main>'
Gem files will remain installed in
/usr/local/lib/ruby/gems/1.9.1/gems/eventmachine-0.12.10
for inspection. Results logged to
/usr/local/lib/ruby/gems/1.9.1/gems/eventmachine-0.12.10/ext/gem_make.out
在构建 C 扩展时,它似乎中断了。我尝试了各种解决方案,例如“ Mac OS X Leopard 安装 ruby gem eventmachine ”,但没有运气。