ubuntu 尝试通过RVM安装Ruby时出现错误“__rvm_make -j 4”

wrrgggsh  于 2022-11-02  发布在  Ruby
关注(0)|答案(1)|浏览(198)

我在一个全栈开发人员训练营,我们需要安装Ruby on Rails。到目前为止,我已经启用了“Windows子系统for Linux”功能,安装了WSL 2,安装了Ubuntu,安装了curl,pnupg和git。
我正在尝试使用以下命令安装RVM:

curl -sSL https://get.rvm.io | bash -s stable --ruby

但运行“__rvm_make -j 4”时总是出现错误
我正在使用Windows 10家庭版。
以下是日志文件的缩写形式。自Open SSL 3.0以来,有更多关于函数被弃用的警告。

In file included from /usr/include/openssl/x509.h:36,
                 from /usr/include/openssl/x509v3.h:25,
                 from ossl.h:23,
                 from ossl_pkey_rsa.c:10:
/usr/include/openssl/rsa.h:225:28: note: declared here
  225 | OSSL_DEPRECATEDIN_3_0 void RSA_get0_crt_params(const RSA *r,
      |                            ^~~~~~~~~~~~~~~~~~~
ossl_pkey_rsa.c: In function ‘ossl_rsa_get_iqmp’:
ossl_pkey_rsa.c:880:1: warning: ‘EVP_PKEY_get0_RSA’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
  880 | OSSL_PKEY_BN_DEF3(rsa, RSA, crt_params, dmp1, dmq1, iqmp)
      | ^~~~~~~~~~~~~~~~~
In file included from /usr/include/openssl/x509.h:29,
                 from /usr/include/openssl/x509v3.h:25,
                 from ossl.h:23,
                 from ossl_pkey_rsa.c:10:
/usr/include/openssl/evp.h:1346:22: note: declared here
 1346 | const struct rsa_st *EVP_PKEY_get0_RSA(const EVP_PKEY *pkey);
      |                      ^~~~~~~~~~~~~~~~~
ossl_pkey_rsa.c:23:11: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   23 |     (rsa) = EVP_PKEY_get0_RSA(_pkey); \
      |           ^
ossl_pkey.h:102:9: note: in expansion of macro ‘GetRSA’
  102 |         Get##_type(self, obj);                                          \
      |         ^~~
ossl_pkey.h:114:9: note: in expansion of macro ‘OSSL_PKEY_BN_DEF_GETTER0’
  114 |         OSSL_PKEY_BN_DEF_GETTER0(_keytype, _type, a3,                   \
      |         ^~~~~~~~~~~~~~~~~~~~~~~~
ossl_pkey.h:211:9: note: in expansion of macro ‘OSSL_PKEY_BN_DEF_GETTER3’
  211 |         OSSL_PKEY_BN_DEF_GETTER3(_keytype, _type, _group, a1, a2, a3)   \
      |         ^~~~~~~~~~~~~~~~~~~~~~~~
ossl_pkey_rsa.c:880:1: note: in expansion of macro ‘OSSL_PKEY_BN_DEF3’
  880 | OSSL_PKEY_BN_DEF3(rsa, RSA, crt_params, dmp1, dmq1, iqmp)
      | ^~~~~~~~~~~~~~~~~
ossl_pkey_rsa.c:880:1: warning: ‘RSA_get0_crt_params’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
In file included from /usr/include/openssl/x509.h:36,
                 from /usr/include/openssl/x509v3.h:25,
                 from ossl.h:23,
                 from ossl_pkey_rsa.c:10:
/usr/include/openssl/rsa.h:225:28: note: declared here
  225 | OSSL_DEPRECATEDIN_3_0 void RSA_get0_crt_params(const RSA *r,
      |                            ^~~~~~~~~~~~~~~~~~~
ossl_pkey_rsa.c: In function ‘ossl_rsa_set_crt_params’:
ossl_pkey_rsa.c:880:1: warning: ‘EVP_PKEY_get0_RSA’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
  880 | OSSL_PKEY_BN_DEF3(rsa, RSA, crt_params, dmp1, dmq1, iqmp)
      | ^~~~~~~~~~~~~~~~~
In file included from /usr/include/openssl/x509.h:29,
                 from /usr/include/openssl/x509v3.h:25,
                 from ossl.h:23,
                 from ossl_pkey_rsa.c:10:
/usr/include/openssl/evp.h:1346:22: note: declared here
 1346 | const struct rsa_st *EVP_PKEY_get0_RSA(const EVP_PKEY *pkey);
      |                      ^~~~~~~~~~~~~~~~~
ossl_pkey_rsa.c:23:11: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   23 |     (rsa) = EVP_PKEY_get0_RSA(_pkey); \
      |           ^
ossl_pkey.h:135:9: note: in expansion of macro ‘GetRSA’
  135 |         Get##_type(self, obj);                                          \
      |         ^~~
ossl_pkey.h:212:9: note: in expansion of macro ‘OSSL_PKEY_BN_DEF_SETTER3’
  212 |         OSSL_PKEY_BN_DEF_SETTER3(_keytype, _type, _group, a1, a2, a3)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~
ossl_pkey_rsa.c:880:1: note: in expansion of macro ‘OSSL_PKEY_BN_DEF3’
  880 | OSSL_PKEY_BN_DEF3(rsa, RSA, crt_params, dmp1, dmq1, iqmp)
      | ^~~~~~~~~~~~~~~~~
ossl_pkey_rsa.c:880:1: warning: ‘RSA_set0_crt_params’ is deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
In file included from /usr/include/openssl/x509.h:36,
                 from /usr/include/openssl/x509v3.h:25,
                 from ossl.h:23,
                 from ossl_pkey_rsa.c:10:
/usr/include/openssl/rsa.h:209:27: note: declared here
  209 | OSSL_DEPRECATEDIN_3_0 int RSA_set0_crt_params(RSA *r,
      |                           ^~~~~~~~~~~~~~~~~~~
ossl_pkey_rsa.c: In function ‘Init_ossl_rsa’:
ossl_pkey_rsa.c:885:58: error: ‘RSA_SSLV23_PADDING’ undeclared (first use in this function); did you mean ‘RSA_NO_PADDING’?
  885 | #define DefRSAConst(x) rb_define_const(cRSA, #x, INT2NUM(RSA_##x))
      |                                                          ^~~~
ossl_pkey_rsa.c:950:5: note: in expansion of macro ‘DefRSAConst’
  950 |     DefRSAConst(SSLV23_PADDING);
      |     ^~~~~~~~~~~
ossl_pkey_rsa.c:885:58: note: each undeclared identifier is reported only once for each function it appears in
  885 | #define DefRSAConst(x) rb_define_const(cRSA, #x, INT2NUM(RSA_##x))
      |                                                          ^~~~
ossl_pkey_rsa.c:950:5: note: in expansion of macro ‘DefRSAConst’
  950 |     DefRSAConst(SSLV23_PADDING);
      |     ^~~~~~~~~~~
cc1: note: unrecognized command-line option ‘-Wno-self-assign’ may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option ‘-Wno-parentheses-equality’ may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option ‘-Wno-constant-logical-operand’ may have been intended to silence earlier diagnostics
compiling sha2.c
ossl_pkey_rsa.c: At top level:
cc1: note: unrecognized command-line option ‘-Wno-self-assign’ may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option ‘-Wno-parentheses-equality’ may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option ‘-Wno-constant-logical-operand’ may have been intended to silence earlier diagnostics
make[2]:***[Makefile:328: ossl_pkey_rsa.o] Error 1
make[2]: Leaving directory '/home/mmullen/.rvm/src/ruby-3.0.0/ext/openssl'
make[1]:***[exts.mk:260: ext/openssl/all] Error 2
make[1]:***Waiting for unfinished jobs....
installing default sha2 libraries
linking shared-object socket.so
checking ../.././parse.y and ../.././ext/ripper/eventids2.c
In file included from sha2.c:40:
sha2.c:578:28: warning: argument 2 of type ‘sha2_byte[]’ {aka ‘unsigned char[]’} with mismatched bound [-Warray-parameter=]
  578 | int SHA256_Final(sha2_byte digest[], SHA256_CTX* context) {
      |                  ~~~~~~~~~~^~~~~~~~
sha2.h:145:50: note: in definition of macro ‘SHA256_Final’
  145 | #define SHA256_Final(d, c)      SHA256_Finish(c, d)
      |                                                  ^
sha2.h:170:18: note: previously declared as ‘uint8_t[32]’ {aka ‘unsigned char[32]’}
  170 | int SHA256_Final(uint8_t[SHA256_DIGEST_LENGTH], SHA256_CTX*);
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sha2.h:145:50: note: in definition of macro ‘SHA256_Final’
  145 | #define SHA256_Final(d, c)      SHA256_Finish(c, d)
      |                                                  ^
sha2.c:643:44: warning: argument 2 of type ‘char[]’ with mismatched bound [-Warray-parameter=]
  643 | char *SHA256_End(SHA256_CTX* context, char buffer[]) {
      |                                       ~~~~~^~~~~~~~
In file included from sha2.c:40:
sha2.h:171:31: note: previously declared as ‘char[65]’
  171 | char* SHA256_End(SHA256_CTX*, char[SHA256_DIGEST_STRING_LENGTH]);
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sha2.c:946:28: warning: argument 2 of type ‘sha2_byte[]’ {aka ‘unsigned char[]’} with mismatched bound [-Warray-parameter=]
  946 | int SHA512_Final(sha2_byte digest[], SHA512_CTX* context) {
      |                  ~~~~~~~~~~^~~~~~~~
sha2.h:163:50: note: in definition of macro ‘SHA512_Final’
  163 | #define SHA512_Final(d, c)      SHA512_Finish(c, d)
      |                                                  ^
sha2.h:182:18: note: previously declared as ‘uint8_t[64]’ {aka ‘unsigned char[64]’}
  182 | int SHA512_Final(uint8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*);
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sha2.h:163:50: note: in definition of macro ‘SHA512_Final’
  163 | #define SHA512_Final(d, c)      SHA512_Finish(c, d)
      |                                                  ^
sha2.c:976:44: warning: argument 2 of type ‘char[]’ with mismatched bound [-Warray-parameter=]
  976 | char *SHA512_End(SHA512_CTX* context, char buffer[]) {
      |                                       ~~~~~^~~~~~~~
In file included from sha2.c:40:
sha2.h:183:31: note: previously declared as ‘char[129]’
  183 | char* SHA512_End(SHA512_CTX*, char[SHA512_DIGEST_STRING_LENGTH]);
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sha2.c:1022:28: warning: argument 2 of type ‘sha2_byte[]’ {aka ‘unsigned char[]’} with mismatched bound [-Warray-parameter=]
 1022 | int SHA384_Final(sha2_byte digest[], SHA384_CTX* context) {
      |                  ~~~~~~~~~~^~~~~~~~
sha2.h:154:50: note: in definition of macro ‘SHA384_Final’
  154 | #define SHA384_Final(d, c)      SHA384_Finish(c, d)
      |                                                  ^
sha2.h:176:18: note: previously declared as ‘uint8_t[48]’ {aka ‘unsigned char[48]’}
  176 | int SHA384_Final(uint8_t[SHA384_DIGEST_LENGTH], SHA384_CTX*);
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sha2.h:154:50: note: in definition of macro ‘SHA384_Final’
  154 | #define SHA384_Final(d, c)      SHA384_Finish(c, d)
      |                                                  ^
sha2.c:1052:44: warning: argument 2 of type ‘char[]’ with mismatched bound [-Warray-parameter=]
 1052 | char *SHA384_End(SHA384_CTX* context, char buffer[]) {
      |                                       ~~~~~^~~~~~~~
In file included from sha2.c:40:
sha2.h:177:31: note: previously declared as ‘char[97]’
  177 | char* SHA384_End(SHA384_CTX*, char[SHA384_DIGEST_STRING_LENGTH]);
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
installing default ripper libraries
linking shared-object ripper.so
cc1: note: unrecognized command-line option ‘-Wno-self-assign’ may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option ‘-Wno-parentheses-equality’ may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option ‘-Wno-constant-logical-operand’ may have been intended to silence earlier diagnostics
make[2]: Leaving directory '/home/mmullen/.rvm/src/ruby-3.0.0/ext/socket'
linking shared-object digest/sha2.so
make[2]: Leaving directory '/home/mmullen/.rvm/src/ruby-3.0.0/ext/ripper'
make[2]: Leaving directory '/home/mmullen/.rvm/src/ruby-3.0.0/ext/digest/sha2'
make[1]: Leaving directory '/home/mmullen/.rvm/src/ruby-3.0.0'
make:***[uncommon.mk:300: build-ext] Error 2
++ /scripts/functions/support : __rvm_make()  383 > return 2
(END)
ukxgm1gy

ukxgm1gy1#

为了防止其他人偶然发现这个问题,可以在Github issue的答案中找到答案。尽管Ubuntu有一些类似的错误报告,其中有类似的答案,但这看起来是最直接的。

$rvm pkg install openssl
$rvm install ruby-<version> --with-openssl-dir=/usr/share/rvm/usr

相关问题