我运行了宝石安装puma,它因这些错误而失败。
我正在尝试为Learn Enough Ruby Tutorial提供Ruby设置。
[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/openssl@1.1/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/openssl@1.1/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/openssl@1.1/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/openssl@1.1/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/openssl@1.1/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/openssl@1.1/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/openssl@1.1/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/openssl@1.1/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/openssl@1.1/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/openssl@1.1/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
我该如何解决这个问题?
答案 0 :(得分:2)
尝试运行旧版本,然后尝试以下命令:
gem install puma -v '3.3.0' -- --with-opt-dir=/usr/local/opt/openssl
完成后,尝试运行捆绑软件安装。
您还可以考虑检查是否已安装OpenSSL。