2013-02-27 136 views
0

我已经建立了RVM和想做的教程http://zetcode.com/gui/rubygtk/错误而安装gtk2的红宝石宝石

它需要GTK2所以我跑:

gem install gtk2 

它要求我授权安装libglib2.0-的dev

最后失败并显示错误。

This is the log 
    /home/max/.rvm/rubies/ruby-2.0.0-p0/bin/ruby extconf.rb 
    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 -Wunsafe-loop-optimizations option to compiler... yes 
    checking for -Wwrite-strings option to compiler... yes 
    checking for rb_define_alloc_func() in ruby.h... yes 
    checking for rb_block_proc() in ruby.h... yes 
    checking for new allocation framework... yes 
    checking for attribute assignment... no 
    checking for rb_errinfo()... yes 
    checking for cairo... yes 
    checking for rb_cairo.h... yes 
    checking for Win32 OS... no 
    checking for gtk+-2.0... yes 
    checking for st.h... yes 
    checking for ruby/st.h... yes 
    checking for target... x11 
    checking for gtk_plug_get_type() in gtk/gtk.h... yes 
    checking for gtk_socket_get_type() in gtk/gtk.h... yes 
    checking for pango_render_part_get_type() in gtk/gtk.h... yes 
    checking for gtk/gtkfilesystem.h... no 
    checking for X11/Xlib.h... yes 
    checking for main() in -lX11... yes 
    checking for XReadBitmapFileData() in X11/Xlib.h... yes 
    checking for XGetErrorText() in X11/Xlib.h... yes 
    checking for gtk+-unix-print-2.0... yes 
    creating ruby-gtk2.pc 
    creating Makefile 

    make 
    compiling rbgtkfilesel.c 
    In file included from /home/max/.rvm/gems/ruby-2.0.0-p0/gems/glib2-1.2.1/ext/glib2/rbgobject.h:28:0, 
        from rbgtk.h:28, 
        from global.h:28, 
        from rbgtkfilesel.c:25: 
    /home/max/.rvm/gems/ruby-2.0.0-p0/gems/glib2-1.2.1/ext/glib2/rbglib.h:67:0: Warnung: »rb_str_new_cstr« redefiniert [standardmäßig aktiviert] 
    /home/max/.rvm/rubies/ruby-2.0.0-p0/include/ruby-2.0.0/ruby/intern.h:747:0: Anmerkung: dies ist die Stelle der vorherigen Definition 
    compiling rbgtkvruler.c 

[a lot of further errors that variable »rb_str_new_cstr« is being redefined] 

    rbgdkevent.c: In Funktion »gdkevent_s_setting_get«: 
    rbgdkevent.c:390:8: Fehler: expected »(« before »!« token 
    rbgdkevent.c:390:8: Warnung: Anweisung ohne Effekt [-Wunused-value] 
    rbgdkevent.c:391:9: Fehler: expected »;« before »gtype« 
    rbgdkevent.c: In Funktion »gdkeventexpose_set_area«: 
    rbgdkevent.c:468:20: Warnung: Variable »event« gesetzt, aber nicht verwendet [-Wunused-but-set-variable] 
    make: *** [rbgdkevent.o] Fehler 1 

有什么想法吗?由于

回答

0

的错误看起来像OSX clang问题编译红宝石的时候,但它可能只是不兼容的ruby-2.0.0-p0,请确保您有未LLVM基于gcc

gcc -v | grep -i llvm 

输出应该是空的,然后变老的红宝石:

rvm use 1.9.3 --install --default 

,并重新安装宝石:

gem install gtk2 

如果成功打开一个错误的改善与任何clang和/或ruby-2.0.0

兼容性宝石