自从我完成2014年3月11日的Apple上次更新以来,我的开发堆栈完全颠倒了,我尝试一点一点地修复它。现在,当我尝试安装gem glib2
时,我遇到了以下错误:
$ gem install glib2
Building native extensions. This could take a while...
ERROR: Error installing glib2:
ERROR: Failed to build gem native extension.
/Users/ymesserl/.rvm/rubies/ruby-2.0.0-p451/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 Win32 OS... no
checking for gobject-2.0 version (>= 2.12.0)... yes
checking for gthread-2.0... yes
checking for unistd.h... yes
checking for io.h... no
checking for g_spawn_close_pid() in glib.h... no
checking for g_thread_init() in glib.h... no
checking for g_main_depth() in glib.h... no
checking for g_listenv() in glib.h... no
checking for rb_check_array_type() in ruby.h... no
checking for rb_check_hash_type() in ruby.h... no
checking for rb_exec_recursive() in ruby.h... no
checking for rb_errinfo() in ruby.h... no
checking for rb_sourcefile() in ruby.h... no
checking for rb_sourceline() in ruby.h... no
checking for ruby_set_current_source() in ruby.h... no
checking for rb_thread_blocking_region() in ruby.h... no
checking for ruby_native_thread_p() in ruby.h... no
checking for rb_thread_call_with_gvl() in ruby.h... no
checking for rb_str_new_cstr() in ruby.h... no
checking for rb_gc_register_mark_object() in ruby.h... no
checking for rb_exc_new_str() in ruby.h... no
checking for curr_thread in ruby.h,node.h... no
checking for rb_curr_thread in ruby.h,node.h... no
creating ruby-glib2.pc
creating glib-enum-types.c
creating glib-enum-types.h
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling glib-enum-types.c
warning: unknown warning option '-Wunsafe-loop-optimizations'; did you mean '-Wout-of-line-declaration'? [-Wunknown-warning-option]
1 warning generated.
compiling rbglib.c
warning: unknown warning option '-Wunsafe-loop-optimizations'; did you mean '-Wout-of-line-declaration'? [-Wunknown-warning-option]
In file included from rbglib.c:23:
./rbgprivate.h:33:11: warning: 'rb_str_new_cstr' macro redefined
# define rb_str_new_cstr(c_string) rb_str_new2(c_string)
^
/Users/ymesserl/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0/ruby/intern.h:758:9: note: previous definition is here
#define rb_str_new_cstr(str) __extension__ ( \
^
rbglib.c:349:18: error: use of undeclared identifier 'ruby_errinfo'; did you mean 'rb_errinfo'?
rb_exc_raise(rb_errinfo());
^
./rbgprivate.h:29:25: note: expanded from macro 'rb_errinfo'
# define rb_errinfo() (ruby_errinfo)
^
/Users/ymesserl/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0/ruby/ruby.h:579:7: note: 'rb_errinfo' declared here
VALUE rb_errinfo(void);
^
rbglib.c:349:18: warning: incompatible pointer to integer conversion passing 'VALUE (void)' to parameter of type 'VALUE' (aka 'unsigned long') [-Wint-conversion]
rb_exc_raise(rb_errinfo());
^~~~~~~~~~~~
./rbgprivate.h:29:24: note: expanded from macro 'rb_errinfo'
# define rb_errinfo() (ruby_errinfo)
^~~~~~~~~~~~~~
/Users/ymesserl/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0/ruby/intern.h:343:33: note: passing argument to parameter here
NORETURN(void rb_exc_raise(VALUE));
^
/Users/ymesserl/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0/x86_64-darwin13.1.0/ruby/config.h:91:48: note: expanded from macro 'NORETURN'
#define NORETURN(x) __attribute__ ((noreturn)) x
^
rbglib.c:406:18: error: use of undeclared identifier 'ruby_errinfo'; did you mean 'rb_errinfo'?
rb_exc_raise(rb_errinfo());
^
./rbgprivate.h:29:25: note: expanded from macro 'rb_errinfo'
# define rb_errinfo() (ruby_errinfo)
^
/Users/ymesserl/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0/ruby/ruby.h:579:7: note: 'rb_errinfo' declared here
VALUE rb_errinfo(void);
^
rbglib.c:406:18: warning: incompatible pointer to integer conversion passing 'VALUE (void)' to parameter of type 'VALUE' (aka 'unsigned long') [-Wint-conversion]
rb_exc_raise(rb_errinfo());
^~~~~~~~~~~~
./rbgprivate.h:29:24: note: expanded from macro 'rb_errinfo'
# define rb_errinfo() (ruby_errinfo)
^~~~~~~~~~~~~~
/Users/ymesserl/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0/ruby/intern.h:343:33: note: passing argument to parameter here
NORETURN(void rb_exc_raise(VALUE));
^
/Users/ymesserl/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0/x86_64-darwin13.1.0/ruby/config.h:91:48: note: expanded from macro 'NORETURN'
#define NORETURN(x) __attribute__ ((noreturn)) x
^
rbglib.c:499:18: error: use of undeclared identifier 'ruby_errinfo'; did you mean 'rb_errinfo'?
rb_exc_raise(rb_errinfo());
^
./rbgprivate.h:29:25: note: expanded from macro 'rb_errinfo'
# define rb_errinfo() (ruby_errinfo)
^
/Users/ymesserl/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0/ruby/ruby.h:579:7: note: 'rb_errinfo' declared here
VALUE rb_errinfo(void);
^
rbglib.c:499:18: warning: incompatible pointer to integer conversion passing 'VALUE (void)' to parameter of type 'VALUE' (aka 'unsigned long') [-Wint-conversion]
rb_exc_raise(rb_errinfo());
^~~~~~~~~~~~
./rbgprivate.h:29:24: note: expanded from macro 'rb_errinfo'
# define rb_errinfo() (ruby_errinfo)
^~~~~~~~~~~~~~
/Users/ymesserl/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0/ruby/intern.h:343:33: note: passing argument to parameter here
NORETURN(void rb_exc_raise(VALUE));
^
/Users/ymesserl/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0/x86_64-darwin13.1.0/ruby/config.h:91:48: note: expanded from macro 'NORETURN'
#define NORETURN(x) __attribute__ ((noreturn)) x
^
rbglib.c:542:18: error: use of undeclared identifier 'ruby_errinfo'; did you mean 'rb_errinfo'?
rb_exc_raise(rb_errinfo());
^
./rbgprivate.h:29:25: note: expanded from macro 'rb_errinfo'
# define rb_errinfo() (ruby_errinfo)
^
/Users/ymesserl/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0/ruby/ruby.h:579:7: note: 'rb_errinfo' declared here
VALUE rb_errinfo(void);
^
rbglib.c:542:18: warning: incompatible pointer to integer conversion passing 'VALUE (void)' to parameter of type 'VALUE' (aka 'unsigned long') [-Wint-conversion]
rb_exc_raise(rb_errinfo());
^~~~~~~~~~~~
./rbgprivate.h:29:24: note: expanded from macro 'rb_errinfo'
# define rb_errinfo() (ruby_errinfo)
^~~~~~~~~~~~~~
/Users/ymesserl/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0/ruby/intern.h:343:33: note: passing argument to parameter here
NORETURN(void rb_exc_raise(VALUE));
^
/Users/ymesserl/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0/x86_64-darwin13.1.0/ruby/config.h:91:48: note: expanded from macro 'NORETURN'
#define NORETURN(x) __attribute__ ((noreturn)) x
^
rbglib.c:585:18: error: use of undeclared identifier 'ruby_errinfo'; did you mean 'rb_errinfo'?
rb_exc_raise(rb_errinfo());
^
./rbgprivate.h:29:25: note: expanded from macro 'rb_errinfo'
# define rb_errinfo() (ruby_errinfo)
^
/Users/ymesserl/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0/ruby/ruby.h:579:7: note: 'rb_errinfo' declared here
VALUE rb_errinfo(void);
^
rbglib.c:585:18: warning: incompatible pointer to integer conversion passing 'VALUE (void)' to parameter of type 'VALUE' (aka 'unsigned long') [-Wint-conversion]
rb_exc_raise(rb_errinfo());
^~~~~~~~~~~~
./rbgprivate.h:29:24: note: expanded from macro 'rb_errinfo'
# define rb_errinfo() (ruby_errinfo)
^~~~~~~~~~~~~~
/Users/ymesserl/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0/ruby/intern.h:343:33: note: passing argument to parameter here
NORETURN(void rb_exc_raise(VALUE));
^
/Users/ymesserl/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0/x86_64-darwin13.1.0/ruby/config.h:91:48: note: expanded from macro 'NORETURN'
#define NORETURN(x) __attribute__ ((noreturn)) x
^
rbglib.c:628:18: error: use of undeclared identifier 'ruby_errinfo'; did you mean 'rb_errinfo'?
rb_exc_raise(rb_errinfo());
^
./rbgprivate.h:29:25: note: expanded from macro 'rb_errinfo'
# define rb_errinfo() (ruby_errinfo)
^
/Users/ymesserl/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0/ruby/ruby.h:579:7: note: 'rb_errinfo' declared here
VALUE rb_errinfo(void);
^
rbglib.c:628:18: warning: incompatible pointer to integer conversion passing 'VALUE (void)' to parameter of type 'VALUE' (aka 'unsigned long') [-Wint-conversion]
rb_exc_raise(rb_errinfo());
^~~~~~~~~~~~
./rbgprivate.h:29:24: note: expanded from macro 'rb_errinfo'
# define rb_errinfo() (ruby_errinfo)
^~~~~~~~~~~~~~
/Users/ymesserl/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0/ruby/intern.h:343:33: note: passing argument to parameter here
NORETURN(void rb_exc_raise(VALUE));
^
/Users/ymesserl/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0/x86_64-darwin13.1.0/ruby/config.h:91:48: note: expanded from macro 'NORETURN'
#define NORETURN(x) __attribute__ ((noreturn)) x
^
rbglib.c:671:18: error: use of undeclared identifier 'ruby_errinfo'; did you mean 'rb_errinfo'?
rb_exc_raise(rb_errinfo());
^
./rbgprivate.h:29:25: note: expanded from macro 'rb_errinfo'
# define rb_errinfo() (ruby_errinfo)
^
/Users/ymesserl/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0/ruby/ruby.h:579:7: note: 'rb_errinfo' declared here
VALUE rb_errinfo(void);
^
rbglib.c:671:18: warning: incompatible pointer to integer conversion passing 'VALUE (void)' to parameter of type 'VALUE' (aka 'unsigned long') [-Wint-conversion]
rb_exc_raise(rb_errinfo());
^~~~~~~~~~~~
./rbgprivate.h:29:24: note: expanded from macro 'rb_errinfo'
# define rb_errinfo() (ruby_errinfo)
^~~~~~~~~~~~~~
/Users/ymesserl/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0/ruby/intern.h:343:33: note: passing argument to parameter here
NORETURN(void rb_exc_raise(VALUE));
^
/Users/ymesserl/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0/x86_64-darwin13.1.0/ruby/config.h:91:48: note: expanded from macro 'NORETURN'
#define NORETURN(x) __attribute__ ((noreturn)) x
^
rbglib.c:714:18: error: use of undeclared identifier 'ruby_errinfo'; did you mean 'rb_errinfo'?
rb_exc_raise(rb_errinfo());
^
./rbgprivate.h:29:25: note: expanded from macro 'rb_errinfo'
# define rb_errinfo() (ruby_errinfo)
^
/Users/ymesserl/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0/ruby/ruby.h:579:7: note: 'rb_errinfo' declared here
VALUE rb_errinfo(void);
^
rbglib.c:714:18: warning: incompatible pointer to integer conversion passing 'VALUE (void)' to parameter of type 'VALUE' (aka 'unsigned long') [-Wint-conversion]
rb_exc_raise(rb_errinfo());
^~~~~~~~~~~~
./rbgprivate.h:29:24: note: expanded from macro 'rb_errinfo'
# define rb_errinfo() (ruby_errinfo)
^~~~~~~~~~~~~~
/Users/ymesserl/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0/ruby/intern.h:343:33: note: passing argument to parameter here
NORETURN(void rb_exc_raise(VALUE));
^
/Users/ymesserl/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0/x86_64-darwin13.1.0/ruby/config.h:91:48: note: expanded from macro 'NORETURN'
#define NORETURN(x) __attribute__ ((noreturn)) x
^
rbglib.c:757:18: error: use of undeclared identifier 'ruby_errinfo'; did you mean 'rb_errinfo'?
rb_exc_raise(rb_errinfo());
^
./rbgprivate.h:29:25: note: expanded from macro 'rb_errinfo'
# define rb_errinfo() (ruby_errinfo)
^
/Users/ymesserl/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0/ruby/ruby.h:579:7: note: 'rb_errinfo' declared here
VALUE rb_errinfo(void);
^
rbglib.c:757:18: warning: incompatible pointer to integer conversion passing 'VALUE (void)' to parameter of type 'VALUE' (aka 'unsigned long') [-Wint-conversion]
rb_exc_raise(rb_errinfo());
^~~~~~~~~~~~
./rbgprivate.h:29:24: note: expanded from macro 'rb_errinfo'
# define rb_errinfo() (ruby_errinfo)
^~~~~~~~~~~~~~
/Users/ymesserl/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0/ruby/intern.h:343:33: note: passing argument to parameter here
NORETURN(void rb_exc_raise(VALUE));
^
/Users/ymesserl/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0/x86_64-darwin13.1.0/ruby/config.h:91:48: note: expanded from macro 'NORETURN'
#define NORETURN(x) __attribute__ ((noreturn)) x
^
11 warnings and 9 errors generated.
make: *** [rbglib.o] Error 1
make failed, exit code 2
以下是我尝试使用的ruby版本(所有版本都有相同的错误):
$ rvm list
rvm rubies
ruby-1.9.3-p448 [ x86_64 ]
ruby-2.0.0-p247 [ x86_64 ]
=* ruby-2.0.0-p451 [ x86_64 ]
# => - current
# =* - current && default
# * - default
以下是它尝试使用的gcc的特定版本:
$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix
gtk+
已安装:
$ brew install gtk+
Warning: gtk+-2.24.22 already installed
知道如何安装我的宝石吗?感谢
答案 0 :(得分:0)
我通过删除所有自制程序包并使用macports安装它来解决了我的问题。特别是需要glib2(导致错误)的gem是rsvg2,所以我通过重新安装解决了这个问题:
sudo port install ImageMagick
sudo port install librsvg
然后我可以安装我的宝石