【问题标题】:Error while installing ruby GTK2 on mac os x在 mac os x 上安装 ruby​​ GTK2 时出错
【发布时间】:2012-01-09 08:04:45
【问题描述】:

我正在尝试在我的系统上安装 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 1.9.2p290(2011-07-09 修订版 32553)[x86_64-darwin11.0.1]

我做错了什么?

【问题讨论】:

  • 你有安装 GTK 吗? checking for gobject-2.0... no 表示您没有 glib(AFAIK、GTK 需要)。
  • 我已经使用 git clone git://git.gnome.org/gtk+ 从gtk.org/download/index.php 下载了 gtk+,但我仍然遇到同样的错误
  • 你编译安装了吗? Brew 可能是您处理这类事情的最佳选择,一旦到了那里,您就可以使用 brew install gtk+ 并解决问题。

标签: ruby gtk2


【解决方案1】:

@mu-is-too-short 在现场

使用brew install gtk+安装gtk+

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-05-11
    • 2015-12-10
    • 2011-05-16
    • 2015-12-06
    • 1970-01-01
    • 2013-01-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多