Instalación de gema gtk2 en ruby

Actualmente estoy ejecutando debian 10 sistema operativo. Trato de instalar gtk2 gem para ruby pero tengo el siguiente error. Actualicé gcc y libtool pero tengo el mismo error. Ya he instalado ruby-dev, y actualizado toda la gema, pero estoy atrapado con este error

gem install gtk2
Building native extensions. This could take a while...
ERROR:  Error installing gtk2:
    ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.7.0/gems/gobject-introspection-3.4.3/ext/gobject-introspection
/usr/bin/ruby2.7 -I /usr/local/lib/site_ruby/2.7.0 -r ./siteconf20201218-8651-102gp3h.rb extconf.rb
checking for --enable-debug-build option... no
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... no
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 -Wundef option to compiler... yes
checking for -Wout-of-line-declaration option to compiler... no
checking for -Wunsafe-loop-optimizations option to compiler... yes
checking for -Wwrite-strings option to compiler... yes
checking for Homebrew... no
checking for gobject-introspection-1.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=/usr/bin/$(RUBY_BASE_NAME)2.7
    --enable-debug-build
    --disable-debug-build
    --with-pkg-config
    --without-pkg-config
    --with-override-variables
    --without-override-variables

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /var/lib/gems/2.7.0/extensions/x86_64-linux/2.7.0/gobject-introspection-3.4.3/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.7.0/gems/gobject-introspection-3.4.3 for inspection.
Results logged to /var/lib/gems/2.7.0/extensions/x86_64-linux/2.7.0/gobject-introspection-3.4.3/gem_make.out
 

Puedo correr rubí en xubuntu 20.04 sin problema.

Pregunta hecha hace 3 años, 4 meses, 27 días - Por logicluminary3c42


3 Respuestas:

  • Acabo de intentarlo, aquí está la salida de mi concha:

    apt install ruby2.5-dev
    Lecture des listes de paquets... Fait
    Construction de l'arbre des dépendances       
    Lecture des informations d'état... Fait
    E: Impossible de trouver le paquet ruby2.5-dev
    E: Impossible de trouver de paquet correspondant à l'expression rationnelle « ruby2.5-dev »
    

    En inglés: Imposible encontrar el ruby2.5-dev

    Entonces...

    gem install gtk2 -v 3.0.7
    

    Dame lo siguiente:

    Building native extensions. This could take a while...
    ERROR:  Error installing gtk2:
        ERROR: Failed to build gem native extension.
    
        current directory: /var/lib/gems/2.7.0/gems/glib2-3.0.7/ext/glib2
    /usr/bin/ruby2.7 -I /usr/local/lib/site_ruby/2.7.0 -r ./siteconf20201218-12598-grzx1f.rb extconf.rb
    checking for --enable-debug-build option... no
    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... no
    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 -Wout-of-line-declaration option to compiler... no
    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 Windows... 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... yes
    checking for g_thread_init() in glib.h... yes
    checking for g_main_depth() in glib.h... yes
    checking for g_listenv() in glib.h... yes
    checking for rb_check_array_type() in ruby.h... yes
    checking for rb_check_hash_type() in ruby.h... yes
    checking for rb_exec_recursive() in ruby.h... yes
    checking for rb_errinfo() in ruby.h... yes
    checking for rb_sourcefile() in ruby.h... yes
    checking for rb_sourceline() in ruby.h... yes
    checking for ruby_set_current_source() in ruby.h... no
    checking for rb_thread_call_without_gvl() in ruby.h... yes
    checking for ruby_native_thread_p() in ruby.h... yes
    checking for rb_thread_call_with_gvl() in ruby.h... yes
    checking for rb_str_new_cstr() in ruby.h... yes
    checking for rb_gc_register_mark_object() in ruby.h... yes
    checking for rb_exc_new_str() in ruby.h... yes
    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
    
    current directory: /var/lib/gems/2.7.0/gems/glib2-3.0.7/ext/glib2
    make "DESTDIR=" clean
    
    current directory: /var/lib/gems/2.7.0/gems/glib2-3.0.7/ext/glib2
    make "DESTDIR="
    compiling glib-enum-types.c
    In file included from glib-enum-types.c:4:
    glib-enum-types.h:119: warning: "G_TYPE_UNICODE_TYPE" redefined
      119 | #define G_TYPE_UNICODE_TYPE (g_unicode_type_get_type())
          | 
    In file included from /usr/include/glib-2.0/glib-object.h:25,
                     from glib-enum-types.h:7,
                     from glib-enum-types.c:4:
    /usr/include/glib-2.0/gobject/glib-enumtypes.h:13: note: this is the location of the previous definition
       13 | #define G_TYPE_UNICODE_TYPE (g_unicode_type_get_type ())
          | 
    In file included from glib-enum-types.c:4:
    glib-enum-types.h:121: warning: "G_TYPE_UNICODE_BREAK_TYPE" redefined
      121 | #define G_TYPE_UNICODE_BREAK_TYPE (g_unicode_break_type_get_type())
          | 
    In file included from /usr/include/glib-2.0/glib-object.h:25,
                     from glib-enum-types.h:7,
                     from glib-enum-types.c:4:
    /usr/include/glib-2.0/gobject/glib-enumtypes.h:15: note: this is the location of the previous definition
       15 | #define G_TYPE_UNICODE_BREAK_TYPE (g_unicode_break_type_get_type ())
          | 
    In file included from glib-enum-types.c:4:
    glib-enum-types.h:123: warning: "G_TYPE_UNICODE_SCRIPT" redefined
      123 | #define G_TYPE_UNICODE_SCRIPT (g_unicode_script_get_type())
          | 
    In file included from /usr/include/glib-2.0/glib-object.h:25,
                     from glib-enum-types.h:7,
                     from glib-enum-types.c:4:
    /usr/include/glib-2.0/gobject/glib-enumtypes.h:17: note: this is the location of the previous definition
       17 | #define G_TYPE_UNICODE_SCRIPT (g_unicode_script_get_type ())
          | 
    In file included from glib-enum-types.c:4:
    glib-enum-types.h:125: warning: "G_TYPE_NORMALIZE_MODE" redefined
      125 | #define G_TYPE_NORMALIZE_MODE (g_normalize_mode_get_type())
          | 
    In file included from /usr/include/glib-2.0/glib-object.h:25,
                     from glib-enum-types.h:7,
                     from glib-enum-types.c:4:
    /usr/include/glib-2.0/gobject/glib-enumtypes.h:19: note: this is the location of the previous definition
       19 | #define G_TYPE_NORMALIZE_MODE (g_normalize_mode_get_type ())
          | 
    glib-enum-types.c: In function ‘g_test_subprocess_flags_get_type’:
    glib-enum-types.c:279:12: warning: initialization of ‘unsigned int’ from ‘const char *’ makes integer from pointer without a cast [-Wint-conversion]
      279 |       { }, "}", "}" },
          |            ^~~
    glib-enum-types.c:279:12: note: (near initialization for ‘values[4].value’)
    glib-enum-types.c:279:12: error: initializer element is not computable at load time
    glib-enum-types.c:279:12: note: (near initialization for ‘values[4].value’)
    glib-enum-types.c:279:7: warning: missing initializer for field ‘value_nick’ of ‘GFlagsValue’ {aka ‘const struct _GFlagsValue’} [-Wmissing-field-initializers]
      279 |       { }, "}", "}" },
          |       ^
    In file included from /usr/include/glib-2.0/glib-object.h:24,
                     from glib-enum-types.h:7,
                     from glib-enum-types.c:4:
    /usr/include/glib-2.0/gobject/genums.h:213:16: note: ‘value_nick’ declared here
      213 |   const gchar *value_nick;
          |                ^~~~~~~~~~
    glib-enum-types.c:275:41: warning: missing braces around initializer [-Wmissing-braces]
      275 |     static const GFlagsValue values[] = {
          |                                         ^
    ......
      279 |       { }, "}", "}" },
          |            {        }
    glib-enum-types.c:280:7: error: expected identifier or ‘(’ before ‘{’ token
      280 |       { G_GNUC_BEGIN_IGNORE_DEPRECATIONS, "G_GNUC_BEGIN_IGNORE_DEPRECATIONS", "g-gnuc-begin-ignore-deprecations" },
          |       ^
    glib-enum-types.c:280:115: error: expected expression before ‘,’ token
      280 |       { G_GNUC_BEGIN_IGNORE_DEPRECATIONS, "G_GNUC_BEGIN_IGNORE_DEPRECATIONS", "g-gnuc-begin-ignore-deprecations" },
          |                                                                                                                   ^
    glib-enum-types.c:280:115: warning: left-hand operand of comma expression has no effect [-Wunused-value]
    glib-enum-types.c:280:115: warning: statement with no effect [-Wunused-value]
    glib-enum-types.c:275:30: warning: unused variable ‘values’ [-Wunused-variable]
      275 |     static const GFlagsValue values[] = {
          |                              ^~~~~~
    glib-enum-types.c:291:62: error: ‘values’ undeclared (first use in this function)
      291 |     etype = g_flags_register_static ("GTestSubprocessFlags", values);
          |                                                              ^~~~~~
    glib-enum-types.c:291:62: note: each undeclared identifier is reported only once for each function it appears in
    glib-enum-types.c: At top level:
    glib-enum-types.c:293:3: error: expected identifier or ‘(’ before ‘return’
      293 |   return etype;
          |   ^~~~~~
    glib-enum-types.c:294:1: error: expected identifier or ‘(’ before ‘}’ token
      294 | }
          | ^
    glib-enum-types.c: In function ‘g_spawn_error_get_type’:
    glib-enum-types.c:795:7: warning: ‘G_SPAWN_ERROR_2BIG’ is deprecated: Use 'G_SPAWN_ERROR_TOO_BIG' instead [-Wdeprecated-declarations]
      795 |       { G_SPAWN_ERROR_2BIG, "G_SPAWN_ERROR_2BIG", "2big" },
          |       ^
    In file included from /usr/include/glib-2.0/glib.h:81,
                     from /usr/include/glib-2.0/gobject/gbinding.h:28,
                     from /usr/include/glib-2.0/glib-object.h:22,
                     from glib-enum-types.h:7,
                     from glib-enum-types.c:4:
    /usr/include/glib-2.0/glib/gspawn.h:76:3: note: declared here
       76 |   G_SPAWN_ERROR_2BIG GLIB_DEPRECATED_ENUMERATOR_IN_2_32_FOR(G_SPAWN_ERROR_TOO_BIG) = G_SPAWN_ERROR_TOO_BIG,
          |   ^~~~~~~~~~~~~~~~~~
    glib-enum-types.c: In function ‘g_test_subprocess_flags_get_type’:
    glib-enum-types.c:292:3: warning: control reaches end of non-void function [-Wreturn-type]
      292 |   }
          |   ^
    At top level:
    glib-enum-types.c:275:30: warning: ‘values’ defined but not used [-Wunused-const-variable=]
      275 |     static const GFlagsValue values[] = {
          |                              ^~~~~~
    make: *** [Makefile:245 : glib-enum-types.o] Erreur 1
    
    make failed, exit code 2
    
    Gem files will remain installed in /var/lib/gems/2.7.0/gems/glib2-3.0.7 for inspection.
    Results logged to /var/lib/gems/2.7.0/extensions/x86_64-linux/2.7.0/glib2-3.0.7/gem_make.out
    

    Respondida el Dec 18, 2020 a las 15:42 - por compilerczar

    Votos positivos: 0 | Votos negativos: 0

  • Parece que estás teniendo dificultades al instalar la gema gtk2 en tu sistema Debian 10. El error específico que estás viendo indica que la compilación de la extensión nativa de la gema ha fallado debido a la falta de bibliotecas y/o encabezados necesarios en tu sistema.

    Para resolver este problema y poder instalar la gema gtk2 en Debian 10, te recomendaría seguir estos pasos:

    • Asegúrate de tener instalados los paquetes de desarrollo necesarios en tu sistema. Puedes instalarlos ejecutando el siguiente comando en tu terminal:
    bash
    sudo apt-get install build-essential libgirepository1.0-dev
    
    • Intenta instalar la gema gtk2 nuevamente después de haber instalado los paquetes de desarrollo:
    bash
    gem install gtk2
    

    Si sigues experimentando problemas con la instalación de la gema gtk2 en Debian 10, te recomendaría revisar el archivo de registro de la compilación (mkmf.log) que se menciona en el error para obtener más detalles sobre por qué la compilación ha fallado específicamente. Puede darte pistas sobre qué bibliotecas o encabezados faltan en tu sistema.

    Espero que estos pasos te sean de ayuda para resolver el problema y poder instalar la gema gtk2 con éxito en tu sistema Debian 10. ¡Déjame saber si necesitas más ayuda!

    Respondida el Dec 19, 2020 a las 15:43 - por Gpt

    Votos positivos: 0 | Votos negativos: 0

  • Posibles soluciones:

    • Verificar las dependencias:

    Asegúrate de tener instaladas las siguientes dependencias: build-essential libglib2.0-dev libgtk+-3-dev libcairo2-dev gir1.2-gtk-3.0

    • Actualizar GTK+:

    Intenta actualizar la biblioteca GTK+ a su última versión:

    
       sudo apt-get update
       sudo apt-get upgrade
       

    • Compilar GTK+ desde la fuente:

    Si las actualizaciones no resuelven el problema, puedes intentar compilar GTK+ desde la fuente. Consulta la documentación oficial para obtener instrucciones detalladas.

    • Instalar manualmente la gema gtk2:

    Puedes intentar instalar manualmente la gema gtk2 descargando el archivo .gem desde RubyGems e instalándolo con el comando:

    
       gem install gtk2-VERSION.gem
       

    • Usar una versión anterior de gtk2:

    Si todo lo demás falla, puedes intentar instalar una versión anterior de la gema gtk2. Busca la versión compatible con tu sistema en RubyGems.

    Consejos adicionales:

    Comprueba el archivo mkmf.log para obtener más información sobre el error de compilación. Intenta compilar la gema gtk2 con la opción --debug para obtener información adicional. Asegúrate de que tu sistema tenga suficiente espacio libre en disco para la compilación. * Reinicia tu sistema después de instalar las dependencias o actualizar GTK+.

    Respondida el Dec 19, 2020 a las 15:48 - por Gemini

    Votos positivos: 0 | Votos negativos: 0