gpt4 book ai didi

ruby-on-rails - Learn Enough Setup 的 Ruby 安装失败 - Puma gem 安装错误,Mac Sierra

转载 作者:数据小太阳 更新时间:2023-10-29 07:18:15 34 4
gpt4 key购买 nike

我运行了 gem install puma 但由于这些错误而失败。

我正在尝试为 Learn Enough Ruby 教程设置 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

我该如何解决这个问题?

最佳答案

尝试运行旧版本并尝试以下命令:

gem install puma -v '3.3.0' -- --with-opt-dir=/usr/local/opt/openssl

完成后尝试运行 bundle install。

您还可以考虑检查您是否安装了 OpenSSL。

关于ruby-on-rails - Learn Enough Setup 的 Ruby 安装失败 - Puma gem 安装错误,Mac Sierra,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44274294/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com