Home > front end >  An error occurred while installing puma (3.6.0), and Bundler cannot continue
An error occurred while installing puma (3.6.0), and Bundler cannot continue

Time:07-22

i am new in ruby on rails and getting that error can anyone help me ?
An error occurred while installing puma (3.6.0), and Bundler cannot continue.

Fetching gem metadata from https://rubygems.org/........... Fetching gem metadata from https://rubygems.org/. Resolving dependencies...

    Fetching puma 3.6.0
    Installing puma 3.6.0 with native extensions
    Gem::Ext::BuildError: ERROR: Failed to build gem native extension.


current directory: /usr/share/rvm/gems/ruby-2.3.1@rails-devise-roles/gems/puma-3.6.0/ext/puma_http11
/usr/share/rvm/rubies/ruby-2.3.1/bin/ruby -I /usr/share/rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0 -r ./siteconf20220721-19014-16ea41q.rb extconf.rb
checking for BIO_read() in -lcrypto... yes
checking for SSL_CTX_new() in -lssl... yes
checking for openssl/bio.h... yes
creating Makefile

current directory: /usr/share/rvm/gems/ruby-2.3.1@rails-devise-roles/gems/puma-3.6.0/ext/puma_http11
make "DESTDIR=" clean

current directory: /usr/share/rvm/gems/ruby-2.3.1@rails-devise-roles/gems/puma-3.6.0/ext/puma_http11
make "DESTDIR="
compiling mini_ssl.c
mini_ssl.c: In function ‘get_dh1024’:
mini_ssl.c:90:5: error: dereferencing pointer to incomplete type ‘DH {aka struct dh_st}’
   dh->p = BN_bin2bn(dh1024_p, sizeof(dh1024_p), NULL);
     ^~
mini_ssl.c: In function ‘engine_init_server’:
mini_ssl.c:139:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   ID sym_cert = rb_intern("cert");
   ^~
mini_ssl.c:144:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   ID sym_ca = rb_intern("ca");
   ^~
mini_ssl.c:166:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   DH *dh = get_dh1024();
   ^~
mini_ssl.c:170:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   EC_KEY *ecdh = EC_KEY_new_by_curve_name(NID_secp521r1);
   ^~~~~~
mini_ssl.c: In function ‘engine_init_client’:
mini_ssl.c:197:3: warning: ‘DTLSv1_method’ is deprecated [-Wdeprecated-declarations]
   conn->ctx = SSL_CTX_new(DTLSv1_method());
   ^~~~
In file included from /usr/include/openssl/e_os2.h:13:0,
                 from /usr/include/openssl/bio.h:13,
                 from mini_ssl.c:14:
/usr/include/openssl/ssl.h:1870:1: note: declared here
 DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *DTLSv1_method(void)) /* DTLSv1.0 */
 ^
Makefile:238: recipe for target 'mini_ssl.o' failed
make: *** [mini_ssl.o] Error 1

make failed, exit code 2

Gem files will remain installed in /usr/share/rvm/gems/ruby-2.3.1@rails-devise-roles/gems/puma-3.6.0 for inspection.
Results logged to /usr/share/rvm/gems/ruby-2.3.1@rails-devise-roles/extensions/x86_64-linux/2.3.0/puma-3.6.0/gem_make.out

An error occurred while installing puma (3.6.0), and Bundler cannot continue.
Make sure that `gem install puma -v '3.6.0' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  puma

CodePudding user response:

You need to install dev tools

sudo apt-get install libssl-dev

CodePudding user response:

Puma 3.6 is only compatible with the very old (and not supported anymore) version 1.0.2 of OpenSSL. As such, you will only be able to use this version of Puma on very old operating systems who still ship this old version of OpenSSL.

The first version of Puma to support OpenSSL 1.1.0 (which e.g. with Ubuntu 18.04) is Puma 3.7.0.

If you use an even newer operating system shipping only OpenSSL 3.0, you need at least Ruby 3.1 and Puma 5.6.0.

To fix your issue, you should thus update your Puma version.

  • Related