可能重复:
在 ruby 1.9 中调试
我无法安装 ruby-debug19。我尝试关注http://isitruby19.com/linecache19但它对我 没有帮助
=======================================
> 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
在本地安装 ruby-debug19 我从上面的链接中得到了问题的答案,该链接基本上将所有 *.h *.c *.inc 文件放入以下文件夹
ruby -rmkmf -e 'puts Config::CONFIG["rubyhdrdir"] + "/" + "ruby-" + RUBY_VERSION.to_s + "-p" + RUBY_PATCHLEVEL.to_s'
但我对这个灵魂不满意。如果我要求客户安装 ruby,我几乎不能指望出售这个特殊的解决方案来解决这个问题。
那么有没有办法避免这种复制?
有人可以帮帮我吗。谢谢苏