Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.1K
Views
Gem::Ext::BuildError: ERROR: No se pudo crear la extensión nativa de gem en macOS Monterey

Cuando ejecuto la bundle install en mi proyecto Rails 5, obtengo una serie de errores en las gemas que parecen tener extensiones nativas. Aquí está la parte superior de la salida de una de esas gemas:

 Installing nio4r 1.2.1 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. checking for unistd.h... yes checking for rb_thread_blocking_region()... no checking for rb_thread_call_without_gvl()... yes checking for sys/select.h... yes checking for poll.h... yes checking for sys/epoll.h... no checking for sys/event.h... yes checking for sys/queue.h... yes checking for port.h... no checking for sys/resource.h... yes creating Makefile current directory: /Users/<my-username>/.rvm/gems/ruby-2.7.4/gems/nio4r-1.2.1/ext/nio4r make "DESTDIR=" clean current directory: /Users/<my-username>/.rvm/gems/ruby-2.7.4/gems/nio4r-1.2.1/ext/nio4r make "DESTDIR=" compiling monitor.c monitor.c:91:24: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro] if(interests_id == rb_intern("r")) { ^~~~~~~~~~~~~~ /Users/<my-username>/.rvm/rubies/ruby-2.7.4/include/ruby-2.7.0/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ monitor.c:91:24: note: '{' token is here if(interests_id == rb_intern("r")) { ^~~~~~~~~~~~~~

He probado varias cosas.

Según esta publicación , probé las siguientes sugerencias:

 # didn't fix it bundle config build.nio4r --with-cflags="-std=c99" bundle # didn't fix it xcode-select --install sudo xcodebuild -license accept bundle

También hice referencia a esta guía de Go Rails , específicamente la sección "Pasos finales" que se ocupa de las gemas que requieren extensiones C, pero ese comando parece no aplicarse porque no migré mi macOS desde Mojave.

En este punto, no estoy seguro de qué probar a continuación. En última instancia: parece que el problema gira en torno a la imposibilidad de instalar gemas que requieren extensiones C.

Medioambiente:

  • macOS Monterey versión 12.2
  • Usando rvm con ruby versión 2.7.4
  • El proyecto está usando Rails versión 5.0.1
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Resulta que el problema era que en el archivo Gemfile.lock , estaba bloqueado para usar una versión anterior de bundler . Simplemente eliminamos Gemfile.lock y volvimos a ejecutar el bundle para regenerar Gemfile.lock . Eso lo resolvió. Ahora dice esto en la parte inferior del archivo Gemfile.lock , por lo que le gustó esta versión del paquete:

 BUNDLED WITH 2.3.9
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!