I ran the gem install puma and it failed with these errors.
I am trying to get Ruby setup for the Learn Enough Ruby Tutorial.
[developer]$gem install puma -v '3.4.0'
Building native extensions. This could take a while...
ERROR: Error installing puma:
ERROR: Failed to build gem native extension.
current directory: /Users/Jim/.rvm/gems/ruby-2.4.0@newgemset/gems/puma-3.4.0/ext/puma_http11
/Users/Jim/.rvm/rubies/ruby-2.4.0/bin/ruby -r ./siteconf20170530-50736-wm8q2m.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: /Users/Jim/.rvm/gems/ruby-2.4.0@newgemset/gems/puma-3.4.0/ext/puma_http11
make "DESTDIR=" clean
current directory: /Users/Jim/.rvm/gems/ruby-2.4.0@newgemset/gems/puma-3.4.0/ext/puma_http11
make "DESTDIR="
compiling http11_parser.c
ext/http11/http11_parser.rl:111:17: warning: comparison of integers of different signs: 'long' and 'unsigned long' [-Wsign-compare]
assert(pe - p == len - off && "pointers aren't same distance");
~~~~~~ ^ ~~~~~~~~~
/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
ext/http11/http11_parser.c:43:18: warning: unused variable 'puma_parser_en_main' [-Wunused-const-variable]
static const int puma_parser_en_main = 1;
^
2 warnings generated.
compiling io_buffer.c
compiling mini_ssl.c
mini_ssl.c:90:5: error: incomplete definition of type 'struct dh_st'
dh->p = BN_bin2bn(dh1024_p, sizeof(dh1024_p), NULL);
~~^
/usr/local/opt/[email protected]/include/openssl/ossl_typ.h:104:16: note: forward declaration of 'struct dh_st'
typedef struct dh_st DH;
^
mini_ssl.c:91:5: error: incomplete definition of type 'struct dh_st'
dh->g = BN_bin2bn(dh1024_g, sizeof(dh1024_g), NULL);
~~^
/usr/local/opt/[email protected]/include/openssl/ossl_typ.h:104:16: note: forward declaration of 'struct dh_st'
typedef struct dh_st DH;
^
mini_ssl.c:93:10: error: incomplete definition of type 'struct dh_st'
if ((dh->p == NULL) || (dh->g == NULL)) {
~~^
/usr/local/opt/[email protected]/include/openssl/ossl_typ.h:104:16: note: forward declaration of 'struct dh_st'
typedef struct dh_st DH;
^
mini_ssl.c:93:29: error: incomplete definition of type 'struct dh_st'
if ((dh->p == NULL) || (dh->g == NULL)) {
~~^
/usr/local/opt/[email protected]/include/openssl/ossl_typ.h:104:16: note: forward declaration of 'struct dh_st'
typedef struct dh_st DH;
^
mini_ssl.c:192:27: warning: 'DTLSv1_method' is deprecated [-Wdeprecated-declarations]
conn->ctx = SSL_CTX_new(DTLSv1_method());
^
/usr/local/opt/[email protected]/include/openssl/ssl.h:1630:45: note: 'DTLSv1_method' has been explicitly marked deprecated here
DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *DTLSv1_method(void)) /* DTLSv1.0 */
^
mini_ssl.c:228:20: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
int verify_err = SSL_get_verify_result(ssl);
~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~
mini_ssl.c:241:13: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
err = ERR_get_error();
~ ^~~~~~~~~~~~~~~
3 warnings and 4 errors generated.
make: *** [mini_ssl.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/Jim/.rvm/gems/ruby-2.4.0@newgemset/gems/puma-3.4.0 for inspection.
Results logged to /Users/Jim/.rvm/gems/ruby-2.4.0@newgemset/extensions/x86_64-darwin-16/2.4.0/puma-3.4.0/gem_make.out
[developer]$gem install puma -v '3.4.0'
Building native extensions. This could take a while...
ERROR: Error installing puma:
ERROR: Failed to build gem native extension.
current directory: /Users/Jim/.rvm/gems/ruby-2.4.0@newgemset/gems/puma-3.4.0/ext/puma_http11
/Users/Jim/.rvm/rubies/ruby-2.4.0/bin/ruby -r ./siteconf20170530-51101-sgcz5z.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: /Users/Jim/.rvm/gems/ruby-2.4.0@newgemset/gems/puma-3.4.0/ext/puma_http11
make "DESTDIR=" clean
current directory: /Users/Jim/.rvm/gems/ruby-2.4.0@newgemset/gems/puma-3.4.0/ext/puma_http11
make "DESTDIR="
compiling http11_parser.c
ext/http11/http11_parser.rl:111:17: warning: comparison of integers of different signs: 'long' and 'unsigned long' [-Wsign-compare]
assert(pe - p == len - off && "pointers aren't same distance");
~~~~~~ ^ ~~~~~~~~~
/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
ext/http11/http11_parser.c:43:18: warning: unused variable 'puma_parser_en_main' [-Wunused-const-variable]
static const int puma_parser_en_main = 1;
^
2 warnings generated.
compiling io_buffer.c
compiling mini_ssl.c
mini_ssl.c:90:5: error: incomplete definition of type 'struct dh_st'
dh->p = BN_bin2bn(dh1024_p, sizeof(dh1024_p), NULL);
~~^
/usr/local/opt/[email protected]/include/openssl/ossl_typ.h:104:16: note: forward declaration of 'struct dh_st'
typedef struct dh_st DH;
^
mini_ssl.c:91:5: error: incomplete definition of type 'struct dh_st'
dh->g = BN_bin2bn(dh1024_g, sizeof(dh1024_g), NULL);
~~^
/usr/local/opt/[email protected]/include/openssl/ossl_typ.h:104:16: note: forward declaration of 'struct dh_st'
typedef struct dh_st DH;
^
mini_ssl.c:93:10: error: incomplete definition of type 'struct dh_st'
if ((dh->p == NULL) || (dh->g == NULL)) {
~~^
/usr/local/opt/[email protected]/include/openssl/ossl_typ.h:104:16: note: forward declaration of 'struct dh_st'
typedef struct dh_st DH;
^
mini_ssl.c:93:29: error: incomplete definition of type 'struct dh_st'
if ((dh->p == NULL) || (dh->g == NULL)) {
~~^
/usr/local/opt/[email protected]/include/openssl/ossl_typ.h:104:16: note: forward declaration of 'struct dh_st'
typedef struct dh_st DH;
^
mini_ssl.c:192:27: warning: 'DTLSv1_method' is deprecated [-Wdeprecated-declarations]
conn->ctx = SSL_CTX_new(DTLSv1_method());
^
/usr/local/opt/[email protected]/include/openssl/ssl.h:1630:45: note: 'DTLSv1_method' has been explicitly marked deprecated here
DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *DTLSv1_method(void)) /* DTLSv1.0 */
^
mini_ssl.c:228:20: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
int verify_err = SSL_get_verify_result(ssl);
~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~
mini_ssl.c:241:13: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
err = ERR_get_error();
~ ^~~~~~~~~~~~~~~
3 warnings and 4 errors generated.
make: *** [mini_ssl.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/Jim/.rvm/gems/ruby-2.4.0@newgemset/gems/puma-3.4.0 for inspection.
Results logged to /Users/Jim/.rvm/gems/ruby-2.4.0@newgemset/extensions/x86_64-darwin-16/2.4.0/puma-3.4.0/gem_make.out
How can I solve this?
Try running an older version and try the below commands:
gem install puma -v '3.3.0' -- --with-opt-dir=/usr/local/opt/openssl
once done then try running bundle install.
You may also consider checking if you have OpenSSL installed or not.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With