RaelB
RaelB

Reputation: 3481

Error when try to install ruby gtk3 gem

I have installed ruby 2.1.6 x64 on Windows 7 x64, to C:\Ruby21-x64. I also downloaded and "installed" the appropriate DevKit

When I try to install the gtk3 gem I get the following error:

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

My list of installed gems is:

*** 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)

Any ideas of how to solve?

Thanks

Upvotes: 0

Views: 1263

Answers (1)

RaelB
RaelB

Reputation: 3481

This issue is answered in a related question that I had: How to include x86-mingw32 binaries when install a gem

One does not need to install DevKit (and maybe better not too). The problem is that the installer does not download the gem with windows binaries (-x86-mingw32).

Once I updated to newer rubygems version (gem update --system) the problem is solved.

Upvotes: 1

Related Questions