2012-06-26 242 views
0

可能重复:
Debugging in ruby 1.9宝石安装红宝石debug19失败

我无法安装红宝石debug19。 我试图按照http://isitruby19.com/linecache19但因此未帮我 我也跟着Installing Gems without rvm, as root, with explicit version of ruby 的步骤也没有帮助

====================== ================

> [email protected]:/# ruby -v ruby 
> 1.9.2p290 (2011-07-09 revision 32553) [i686-linux] 

=========================== ===========

> [email protected]:/# gem -v 
> 1.8.10 

================================ ======

> [email protected]:~/# 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 

======================================

[email protected]:~# 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' 

但我不满意这点。如果我要求客户安装红宝石,我很难指望将这个特定的解决方案出售给这个问题。

那么有没有办法避免这种复制?

有人可以帮助我。 谢谢 苏

回答

0

你不说什么操作系统,但我有一个类似的问题,而我的OSX狮子安装。错误是为了不同的宝石,但错误是一样的。

原来是某种XCode版本冲突。 See my solution here.

如果没有帮助,请检查mkmf.log文件。它可能包含你正在寻找的答案的线索。

+0

root @ vm:〜/#uname -a Linux vm 3.0.0-12-generic#20-Ubuntu SMP Fri Oct 10 7:50:42 UTC 2011 i686 i686 i386 GNU/Linux 它是ubuntu oneric linux方框 –

+0

我在哪里可以找到mkmf.log? –

+0

在Ubuntu上不确定。尝试去'/ usr/local/lib/ruby​​/gems'并执行'find。 | grep mkmf.log' –