2013-02-27 143 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

兼容性寶石