可能重复:
Debugging in ruby 1.9
我无法安装ruby-debug19。 我试图跟随http://isitruby19.com/linecache19,但它没有帮助我 我也按照Installing Gems without rvm, as root, with explicit version of ruby中的步骤进行操作 这也没有帮助
======================================
> root@vm:/# ruby -v ruby
> 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]
======================================
> root@vm:/# gem -v
> 1.8.10
======================================
> root@vm:~/# uname -a
> Linux vm 3.0.0-12-generic #20-Ubuntu SMP Fri Oct 7 14:50:42 UTC 2011 i686 i686 386 GNU/Linux
======================================
root@vm:~# sudo gem install ruby-debug19
Building native extensions. This could take a while...
ERROR: Error installing ruby-debug19:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for vm_core.h... no
checking for vm_core.h... no
*** 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
--with-ruby-dir
--without-ruby-dir
--with-ruby-include
--without-ruby-include=${ruby-dir}/include
--with-ruby-lib
--without-ruby-lib=${ruby-dir}/lib
/usr/local/lib/ruby/1.9.1/net/http.rb:644:in `initialize': Connection timed out - connect(2) (Errno::ETIMEDOUT)
from /usr/local/lib/ruby/1.9.1/net/http.rb:644:in `open'
from /usr/local/lib/ruby/1.9.1/net/http.rb:644:in `block in connect'
from /usr/local/lib/ruby/1.9.1/timeout.rb:44:in `timeout'
from /usr/local/lib/ruby/1.9.1/timeout.rb:89:in `timeout'
from /usr/local/lib/ruby/1.9.1/net/http.rb:644:in `connect'
from /usr/local/lib/ruby/1.9.1/net/http.rb:637:in `do_start'
from /usr/local/lib/ruby/1.9.1/net/http.rb:626:in `start'
from /usr/local/lib/ruby/1.9.1/net/http.rb:1168:in `request'
from /usr/local/lib/ruby/gems/1.9.1/gems/ruby_core_source-0.1.5/lib/contrib/uri_ext.rb:239:in `block in read'
from /usr/local/lib/ruby/gems/1.9.1/gems/ruby_core_source-0.1.5/lib/contrib/uri_ext.rb:286:in `connect'
from /usr/local/lib/ruby/gems/1.9.1/gems/ruby_core_source-0.1.5/lib/contrib/uri_ext.rb:234:in `read'
from /usr/local/lib/ruby/gems/1.9.1/gems/ruby_core_source-0.1.5/lib/contrib/uri_ext.rb:128:in `download'
from /usr/local/lib/ruby/gems/1.9.1/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:55:in `block in create_makefile_with_core'
from /usr/local/lib/ruby/1.9.1/tempfile.rb:320:in `open'
from /usr/local/lib/ruby/gems/1.9.1/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:51:in `create_makefile_with_core'
from extconf.rb:19:in `<main>'
Requesting http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.gz
Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/linecache19-0.5.12 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/linecache19-0.5.12/ext/trace_nums/gem_make.out
Installing ruby-debug19 locally 我得到了上述链接中的问题的答案 基本上将所有* .h * .c * .inc文件放入下面的文件夹
ruby -rmkmf -e 'puts Config::CONFIG["rubyhdrdir"] + "/" + "ruby-" + RUBY_VERSION.to_s + "-p" + RUBY_PATCHLEVEL.to_s'
但我对这种灵魂不满意。如果我要求客户安装ruby,我几乎不能指望出售这个问题的特定解决方案。
那么有没有办法避免这种复制?
有人可以帮助我。 谢谢 苏
答案 0 :(得分:0)
你没有说你正在运行什么操作系统,但是我的OSX Lion安装一段时间后我遇到了类似的问题。错误是针对不同的gem,但错误是相同的。
原来是某种XCode版本冲突。 See my solution here.
如果这没有帮助,请查看mkmf.log
文件。它可能包含您正在寻找的答案的线索。