尝试安装ruby gtk3 gem时出错

时间:2015-07-22 01:52:47

标签: ruby windows gtk3

我在Windows 7 x64上安装了ruby 2.1.6 x64到C:\ Ruby21-x64。 我也下载了"安装"适当的DevKit

当我尝试安装gtk3 gem时,我收到以下错误:

 <div>single ' double " single ' </div>

<form>
</form>    

$("form").append('<input type="text" value = "' + $("div").text().replace(/"/g,'\"') + '" />');

我安装的宝石列表是:

C:\>gem install gtk3                                                                                      
Fetching: gobject-introspection-2.2.5-x64-mingw32.gem (100%)                                              
Successfully installed gobject-introspection-2.2.5-x64-mingw32                                            
Fetching: gio2-2.2.5-x64-mingw32.gem (100%)                                                               
Successfully installed gio2-2.2.5-x64-mingw32                                                             
Fetching: cairo-gobject-2.2.5-x64-mingw32.gem (100%)                                                      
Successfully installed cairo-gobject-2.2.5-x64-mingw32                                                    
Fetching: gdk3-2.2.5-x64-mingw32.gem (100%)                                                               
Successfully installed gdk3-2.2.5-x64-mingw32                                                             
Fetching: gtk3-2.2.5.gem (100%)                                                                           
Temporarily enhancing PATH to include DevKit...                                                           
Building native extensions.  This could take a while...                                                   
ERROR:  Error installing gtk3:                                                                            
        ERROR: Failed to build gem native extension.                                                      

    C:/Ruby21-x64/bin/ruby.exe extconf.rb                                                                 
checking for --enable-debug-build option... no                                                            
checking for -Wall option to compiler... yes                                                              
checking for -Waggregate-return option to compiler... yes                                                 
checking for -Wcast-align option to compiler... yes                                                       
checking for -Wextra option to compiler... yes                                                            
checking for -Wformat=2 option to compiler... yes                                                         
checking for -Winit-self option to compiler... yes                                                        
checking for -Wlarger-than-65500 option to compiler... yes                                                
checking for -Wmissing-declarations option to compiler... yes                                             
checking for -Wmissing-format-attribute option to compiler... yes                                         
checking for -Wmissing-include-dirs option to compiler... yes                                             
checking for -Wmissing-noreturn option to compiler... yes                                                 
checking for -Wmissing-prototypes option to compiler... yes                                               
checking for -Wnested-externs option to compiler... yes                                                   
checking for -Wold-style-definition option to compiler... yes                                             
checking for -Wpacked option to compiler... yes                                                           
checking for -Wp,-D_FORTIFY_SOURCE=2 option to compiler... yes                                            
checking for -Wpointer-arith option to compiler... yes                                                    
checking for -Wswitch-default option to compiler... yes                                                   
checking for -Wswitch-enum option to compiler... yes                                                      
checking for -Wundef option to compiler... yes                                                            
checking for -Wout-of-line-declaration option to compiler... no                                           
checking for -Wunsafe-loop-optimizations option to compiler... yes                                        
checking for -Wwrite-strings option to compiler... yes                                                    
checking for rb_define_alloc_func() in ruby.h... no                                                       
checking for rb_block_proc() in ruby.h... no                                                              
checking for new allocation framework... yes                                                              
checking for attribute assignment... no                                                                   
checking for rb_errinfo()... no                                                                           
checking for cairo... yes                                                                                 
checking for rb_cairo.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=C:/Ruby21-x64/bin/ruby                                                                     
        --enable-debug-build                                                                              
        --disable-debug-build                                                                             
        --with-pkg-config                                                                                 
        --without-pkg-config                                                                              
        --with-override-variables                                                                         
        --without-override-variables                                                                      

extconf failed, exit code 1                                                                               

Gem files will remain installed in C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/gtk3-2.2.5 for inspection.      
Results logged to C:/Ruby21-x64/lib/ruby/gems/2.1.0/extensions/x64-mingw32/2.1.0/gtk3-2.2.5/gem_make.out

有关如何解决的任何想法?

由于

1 个答案:

答案 0 :(得分:1)

我在一个相关的问题中回答了这个问题: How to include x86-mingw32 binaries when install a gem

一个人不需要安装DevKit(也许最好不要安装)。问题是安装程序没有使用Windows二进制文件(-x86-mingw32)下载gem。

一旦我更新到更新的rubygems版本(gem update --system),问题就解决了。