在mac os x上安装ruby GTK2时出错

在mac os x上安装ruby GTK2时出错,ruby,gtk2,Ruby,Gtk2,我正在尝试在我的系统上安装gtk2 gem,但出现以下错误: MacBook-Air-de-Mateus:~ mateusgomesfreitas$ gem install gtk2 Building native extensions. This could take a while... ERROR: Error installing gtk2: ERROR: Failed to build gem native extension. /Users/mateus

我正在尝试在我的系统上安装gtk2 gem,但出现以下错误:

MacBook-Air-de-Mateus:~ mateusgomesfreitas$ gem install gtk2
Building native extensions.  This could take a while...
ERROR:  Error installing gtk2:
    ERROR: Failed to build gem native extension.

        /Users/mateusgomesfreitas/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb
checking for GCC... 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 Win32 OS... no
checking for gobject-2.0... 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=/Users/mateusgomesfreitas/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
    --with-pkg-config
    --without-pkg-config
    --with-override-variables
    --without-override-variables


Gem files will remain installed in /Users/mateusgomesfreitas/.rvm/gems/ruby-1.9.2-    p290/gems/glib2-1.0.3 for inspection.
Results logged to /Users/mateusgomesfreitas/.rvm/gems/ruby-1.9.2-p290/gems/glib2-1.0.3/ext/glib2/gem_make.out
这是我的清单:

*** LOCAL GEMS ***

abstract (1.0.0)
actionmailer (3.0.10)
actionpack (3.0.10)
activemodel (3.0.10)
activerecord (3.0.10)
activeresource (3.0.10)
activesupport (3.0.10)
arel (2.0.10)
builder (2.1.2)
bundler (1.0.18)
erubis (2.6.6)
i18n (0.5.0)
mail (2.2.19)
mime-types (1.16)
mysql2 (0.3.7, 0.2.13)
pkg-config (1.1.2)
polyglot (0.3.2)
rack (1.2.4, 1.2.3)
rack-mount (0.6.14)
rack-test (0.5.7)
rails (3.0.10)
railties (3.0.10)
rake (0.9.2)
rdoc (3.9.4)
rubygems-update (1.8.10)
sqlite3 (1.3.4)
thor (0.14.6)
treetop (1.4.10)
tzinfo (0.3.29)
以及我的ruby版本: ruby 1.9.2P2902011-07-09修订版32553[x86_64-darwin11.0.1]


我做错了什么?

@mu太短了,这是正确的


使用brew安装gtk+

@mu太短,请立即安装


使用brew安装gtk+

是否安装了gtk?正在检查gobject-2.0。。。否表示您没有glib,这是GTK需要的。我已经从git clone下载了GTK+git://git.gnome.org/gtk+我仍然收到同样的错误你编译并安装了吗?这可能是您进行此类操作的最佳选择,一旦安装完毕,您就可以brew安装gtk+,这应该会解决问题。您是否安装了gtk?正在检查gobject-2.0。。。否表示您没有glib,这是GTK需要的。我已经从git clone下载了GTK+git://git.gnome.org/gtk+我仍然收到同样的错误你编译并安装了吗?这可能是您在这类事情上的最佳选择,一旦有了它,您就可以brew安装gtk+,这应该会解决问题。