Question

My development stack has been completely turned upside down since I've done the Apple last update of March 11, 2014, and I try to fix it bit by bit. Right now I'm stuck with the following error when I try to install the 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

Here is the ruby versions I tried to use (got same errors for all of them):

    $ 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

Here is the specific version of gcc it tries to use:

    $ 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+ is installed:

    $ brew install gtk+
    Warning: gtk+-2.24.22 already installed

Any idea how I could install my gem? Thanks

Was it helpful?

Solution

I solved my problem by removing all my homebrew packages and installing them with macports. Especially the gem that needed glib2 (causing the error) was rsvg2, so I solved the problem by reinstalling:

    sudo port install ImageMagick
    sudo port install librsvg

And then I could install my gems

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top