2012-06-26 353 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' –