Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

301
Visualizações
Failed to build gem native extension when installing bcrypt-ruby gem

When running: gem install bcrypt-ruby -v '3.0.1' I get the following errors:

Building native extensions. This could take a while...
ERROR:  Error installing bcrypt-ruby:
    ERROR: Failed to build gem native extension.

    current directory: /U/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bcrypt-ruby-3.0.1/ext/mri
/U/.rbenv/versions/2.7.2/bin/ruby -I /U/.rbenv/versions/2.7.2/lib/ruby/2.7.0 -r ./siteconf20210824-80693-sdyma7.rb extconf.rb
creating Makefile

current directory: /U/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bcrypt-ruby-3.0.1/ext/mri
make "DESTDIR=" clean

current directory: /U/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bcrypt-ruby-3.0.1/ext/mri
make "DESTDIR="
compiling bcrypt_ext.c
bcrypt_ext.c:27:19: error: implicit declaration of function 'ruby_bcrypt' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    return (VALUE)ruby_bcrypt(args->output, args->key, args->salt);
                  ^
bcrypt_ext.c:27:19: note: did you mean 'ruby_script'?
/U/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:2747:6: note: 'ruby_script' declared here
void ruby_script(const char* name);
     ^
bcrypt_ext.c:42:25: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
            NIL_P(input) ? 0 : RSTRING_LEN(input));
                               ^~~~~~~~~~~~~~~~~~
/U/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1007:6: note: expanded from macro 'RSTRING_LEN'
     RSTRING_EMBED_LEN(str) : \
     ^~~~~~~~~~~~~~~~~~~~~~
/U/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1003:6: note: expanded from macro 'RSTRING_EMBED_LEN'
     (long)((RBASIC(str)->flags >> RSTRING_EMBED_LEN_SHIFT) & \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bcrypt_ext.c:42:25: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
            NIL_P(input) ? 0 : RSTRING_LEN(input));
                               ^~~~~~~~~~~~~~~~~~
/U/.rbenv/versions/2.7.2/include/ruby-2.7.0/ruby/ruby.h:1008:28: note: expanded from macro 'RSTRING_LEN'
     RSTRING(str)->as.heap.len)
     ~~~~~~~~~~~~~~~~~~~~~~^~~
2 warnings and 1 error generated.
make: *** [bcrypt_ext.o] Error 1

make failed, exit code 2

My Ruby version is 2.7.2. Any ideas what to try to get it installed?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

I had to add a flag when installing:

gem install bcrypt-ruby -v '3.0.1' -- --with-cflags=-Wno-implicit-function-declaration

This installed the gem successfully with Ruby 2.7.2

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda