2015-07-22 145 views
0

我在Windows 7 x64上安装了ruby 2.1.6 x64,到C:\ Ruby21-x64。 我也下载和“安装”适当的devkit尝试安装ruby gtk3宝石时出错

当我尝试安装gtk3宝石,我得到以下错误:

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 

我装宝石的名单是:

*** LOCAL GEMS ***                       

atk (2.2.5 x64-mingw32)                     
bigdecimal (1.2.4)                       
cairo (1.14.1 x64-mingw32)                     
cairo-gobject (2.2.5 x64-mingw32)                   
gdk3 (2.2.5 x64-mingw32)                     
gdk_pixbuf2 (2.2.5 x64-mingw32)                   
gio2 (2.2.5 x64-mingw32)                     
glib2 (2.2.5 x64-mingw32)                     
gobject-introspection (2.2.5 x64-mingw32)                 
gtk2 (2.2.5 x64-mingw32)                     
io-console (0.4.3)                       
json (1.8.1)                        
minitest (4.7.5)                       
pango (2.2.5 x64-mingw32)                     
pkg-config (1.1.6)                       
psych (2.0.5)                        
rake (10.1.0)                        
rdoc (4.1.0)                        
require_all (1.3.2)                      
test-unit (2.1.6.0)                      
vrlib (1.0.16) 

任何想法如何解决?

感谢

+0

我决定卸载x64版本,并安装带有32位DevKit的ruby 2.1.6 32bit。但是,我遇到了同样的问题。 – RaelB

+0

看来像gtk2或gtk3在Windows上不支持至少v2.1.6 这里是我发现的一些链接: [链接1](https://www.ruby-forum.com/topic/4620044) , [链接2](https://github.com/ruby-gnome2/ruby-gnome2/issues/280) – RaelB

回答

1

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

一个人并不需要安装的devkit(也许最好不要太)。问题是安装程序不能下载带有Windows二进制文件的gem(-x86-mingw32)。

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