可以通过RVM安装Ruby,运行错误' __ rvm_make -j4'在Ubuntu 22.04上

发布于 2025-01-27 15:27:43 字数 20740 浏览 5 评论 0原文

我试图安装多个版本的Ruby(2.5.5,2.6.6,2.7.4,3.0.0),在所有情况下,当然,每个版本都给出了相同的错误,在此示例中,我只放置版本2.6.6的错误:

 $ rvm use ruby --install --default 2.6.6
Required ruby-2.6.6 is not installed - installing.
ruby-2.6.6 - #removing src/ruby-2.6.6..
Searching for binary rubies, this might take some time.
No binary rubies available for: ubuntu/22.04/x86_64/ruby-2.6.6.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for ubuntu.
Requirements installation successful.
Installing Ruby from source to: /home/elorat/.rvm/rubies/ruby-2.6.6, this may take a while depending on your cpu(s)...
ruby-2.6.6 - #downloading ruby-2.6.6, this may take a while depending on your connection...
ruby-2.6.6 - #extracting ruby-2.6.6 to /home/elorat/.rvm/src/ruby-2.6.6.....
ruby-2.6.6 - #configuring......................................................................
ruby-2.6.6 - #post-configuration..
ruby-2.6.6 - #compiling..........................................................................................................-
Error running '__rvm_make -j4',
please read /home/elorat/.rvm/log/1652140330_ruby-2.6.6/make.log

There has been an error while running make. Halting the installation.

这是我的工作环境:

 $ rvm --version
rvm 1.29.12-next (master) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]

 $ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04 LTS
Release:    22.04
Codename:   jammy

Update

我无法将整个Make.log文件放置,因为身体仅限于30000个字符; make.log文件为90138个字符。我将放置第一个18788个字符。

这是文件make.log的一部分。

[2022-05-10 07:17:47] __rvm_make
__rvm_make () 
{ 
    \make "$@" || return $?
}
current path: /home/elorat/.rvm/src/ruby-2.6.6
GEM_PATH=/home/elorat/.rvm/gems/ruby-2.6.6:/home/elorat/.rvm/gems/ruby-2.6.6@global
PATH=/home/elorat/.rvm/gems/ruby-2.6.6/bin:/home/elorat/.rvm/gems/ruby-2.6.6@global/bin:/home/elorat/.rvm/rubies/ruby-2.6.6/bin:/home/elorat/.rvm/bin:/home/elorat/.nvm/versions/node/v12.22.9/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
command(2): __rvm_make -j4
++ make -j4
    BASERUBY = echo executable host ruby is required.  use --with-baseruby option.; false
    CC = gcc
    LD = ld
    LDSHARED = gcc -shared
    CFLAGS = -O3 -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wrestrict -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -std=gnu99  -fPIC 
    XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -fvisibility=hidden -fexcess-precision=standard -DRUBY_EXPORT -DCANONICALIZATION_FOR_MATHN
    CPPFLAGS =   -I. -I.ext/include/x86_64-linux -I./include -I. -I./enc/unicode/12.1.0 
    DLDFLAGS = -Wl,--compress-debug-sections=zlib -Wl,-soname,libruby.so.2.6  -fstack-protector-strong  
    SOLIBS = -lz -lpthread -lrt -lrt -lgmp -ldl -lcrypt -lm 
    LANG = en_US.UTF-8
    LC_ALL = 
    LC_CTYPE = 
gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

compiling ./main.c
compiling dmydln.c
compiling miniinit.c
compiling dmyext.c
compiling miniprelude.c
making dummy probes.h
compiling ast.c
compiling bignum.c
compiling class.c
compiling compar.c
In file included from ./include/ruby.h:33,
                 from internal.h:15,
                 from class.c:26:
class.c: In function ‘move_refined_method’:
class.c:955:30: warning: taking address of packed member of ‘struct rb_method_definition_struct’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  955 |             RB_OBJ_WRITE(me, &me->def->body.refined.orig_me, NULL);
./include/ruby/ruby.h:1493:75: note: in definition of macro ‘RB_OBJ_WRITE’
 1493 | #define RB_OBJ_WRITE(a, slot, b)       rb_obj_write((VALUE)(a), (VALUE *)(slot), (VALUE)(b), __FILE__, __LINE__)
      |                                                                           ^~~~
compiling compile.c
compile.c: In function ‘update_catch_except_flags’:
compile.c:1291:54: warning: taking address of packed member of ‘struct iseq_catch_table’ may result in an unaligned pointer value [-Waddress-of-packed-member]
 1291 |         const struct iseq_catch_table_entry *entry = &ct->entries[i];
      |                                                      ^~~~~~~~~~~~~~~
compile.c: In function ‘iseq_set_exception_table’:
compile.c:2356:21: warning: taking address of packed member of ‘struct iseq_catch_table’ may result in an unaligned pointer value [-Waddress-of-packed-member]
 2356 |             entry = &table->entries[i];
      |                     ^~~~~~~~~~~~~~~~~~
compiling complex.c
class.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
compiling cont.c
compiling debug.c
compiling debug_counter.c
compiling dir.c
compiling dln_find.c
compiling encoding.c
compiling enum.c
compiling enumerator.c
compiling error.c
compiling eval.c
compiling file.c
compiling gc.c
gc.c: In function ‘mark_current_machine_context’:
gc.c:4377:36: warning: expression does not compute the number of elements in this array; element type is ‘struct __jmp_buf_tag’, not ‘VALUE’ {aka ‘long unsigned int’} [-Wsizeof-array-div]
 4377 |         VALUE v[sizeof(rb_jmp_buf) / sizeof(VALUE)];
      |                                    ^
gc.c:4377:36: note: add parentheses around the second ‘sizeof’ to silence this warning
compiling hash.c
compiling inits.c
compile.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
compiling io.c
compiling iseq.c
iseq.c: In function ‘rb_iseq_mark’:
iseq.c:252:25: warning: taking address of packed member of ‘struct iseq_catch_table’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  252 |                 entry = &table->entries[i];
      |                         ^~~~~~~~~~~~~~~~~~
iseq.c: In function ‘rb_iseq_disasm_recursive’:
iseq.c:2067:58: warning: taking address of packed member of ‘struct iseq_catch_table’ may result in an unaligned pointer value [-Waddress-of-packed-member]
 2067 |             const struct iseq_catch_table_entry *entry = &body->catch_table->entries[i];
      |                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
iseq.c: In function ‘iseq_iterate_children’:
iseq.c:2200:58: warning: taking address of packed member of ‘struct iseq_catch_table’ may result in an unaligned pointer value [-Waddress-of-packed-member]
 2200 |             const struct iseq_catch_table_entry *entry = &body->catch_table->entries[i];
      |                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
iseq.c: In function ‘iseq_data_to_ary’:
iseq.c:2710:54: warning: taking address of packed member of ‘struct iseq_catch_table’ may result in an unaligned pointer value [-Waddress-of-packed-member]
 2710 |         const struct iseq_catch_table_entry *entry = &iseq_body->catch_table->entries[i];
      |                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compiling load.c
compiling marshal.c
gc.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
iseq.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
compiling math.c
making mjit_config.h
compiling mjit_compile.c
compiling node.c
compiling numeric.c
compiling object.c
compiling pack.c
compiling parse.c
compiling proc.c
compiling process.c
compiling random.c
compiling range.c
compiling rational.c
compiling re.c
compiling regcomp.c
compiling regenc.c
compiling regerror.c
compiling regexec.c
compiling regparse.c
compiling regsyntax.c
compiling ruby.c
compiling safe.c
compiling signal.c
compiling sprintf.c
compiling st.c
compiling strftime.c
strftime.c: In function ‘rb_strftime_with_timespec’:
strftime.c:386:39: warning: comparison is always false due to limited range of data type [-Wtype-limits]
  386 |                         if (vtm->wday < 0 || vtm->wday > 6)
      |                                       ^
strftime.c:397:39: warning: comparison is always false due to limited range of data type [-Wtype-limits]
  397 |                         if (vtm->wday < 0 || vtm->wday > 6)
      |                                       ^
compiling string.c
string.c: In function ‘str_replace_shared_without_enc’:
string.c:1189:13: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
 1189 |             char *ptr2 = STR_HEAP_PTR(str2);
      |             ^~~~
string.c: In function ‘rb_str_setbyte’:
string.c:5471:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
 5471 |     VALUE v = rb_to_int(value);
      |     ^~~~~
string.c: In function ‘get_reg_grapheme_cluster’:
string.c:8521:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
 8521 |         int r = onig_new(&reg_grapheme_cluster, source, source + source_len,
      |         ^~~
strftime.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
compiling struct.c
compiling symbol.c
compiling thread.c
In file included from thread.c:68:
thread_sync.c: In function ‘queue_alloc’:
eval_intern.h:172:64: warning: taking address of packed member of ‘struct rb_queue’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  172 | #define UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem)
eval_intern.h:170:40: note: in definition of macro ‘UNALIGNED_MEMBER_ACCESS’
  170 | # define UNALIGNED_MEMBER_ACCESS(expr) expr
      |                                        ^~~~
thread_sync.c:545:24: note: in expansion of macro ‘UNALIGNED_MEMBER_PTR’
  545 | #define queue_waitq(q) UNALIGNED_MEMBER_PTR(q, waitq)
      |                        ^~~~~~~~~~~~~~~~~~~~
thread_sync.c:590:20: note: in expansion of macro ‘queue_waitq’
  590 |     list_head_init(queue_waitq(q));
      |                    ^~~~~~~~~~~
thread_sync.c: In function ‘queue_fork_check’:
eval_intern.h:172:64: warning: taking address of packed member of ‘struct rb_queue’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  172 | #define UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem)
eval_intern.h:170:40: note: in definition of macro ‘UNALIGNED_MEMBER_ACCESS’
  170 | # define UNALIGNED_MEMBER_ACCESS(expr) expr
      |                                        ^~~~
thread_sync.c:545:24: note: in expansion of macro ‘UNALIGNED_MEMBER_PTR’
  545 | #define queue_waitq(q) UNALIGNED_MEMBER_PTR(q, waitq)
      |                        ^~~~~~~~~~~~~~~~~~~~
thread_sync.c:604:20: note: in expansion of macro ‘queue_waitq’
  604 |     list_head_init(queue_waitq(q));
      |                    ^~~~~~~~~~~
thread_sync.c: In function ‘szqueue_alloc’:
eval_intern.h:172:64: warning: taking address of packed member of ‘struct rb_queue’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  172 | #define UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem)
eval_intern.h:170:40: note: in definition of macro ‘UNALIGNED_MEMBER_ACCESS’
  170 | # define UNALIGNED_MEMBER_ACCESS(expr) expr
      |                                        ^~~~
thread_sync.c:553:27: note: in expansion of macro ‘UNALIGNED_MEMBER_PTR’
  553 | #define szqueue_waitq(sq) UNALIGNED_MEMBER_PTR(sq, q.waitq)
      |                           ^~~~~~~~~~~~~~~~~~~~
thread_sync.c:648:20: note: in expansion of macro ‘szqueue_waitq’
  648 |     list_head_init(szqueue_waitq(sq));
      |                    ^~~~~~~~~~~~~
eval_intern.h:172:64: warning: taking address of packed member of ‘struct rb_szqueue’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  172 | #define UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem)
eval_intern.h:170:40: note: in definition of macro ‘UNALIGNED_MEMBER_ACCESS’
  170 | # define UNALIGNED_MEMBER_ACCESS(expr) expr
      |                                        ^~~~
thread_sync.c:554:27: note: in expansion of macro ‘UNALIGNED_MEMBER_PTR’
  554 | #define szqueue_pushq(sq) UNALIGNED_MEMBER_PTR(sq, pushq)
      |                           ^~~~~~~~~~~~~~~~~~~~
thread_sync.c:649:20: note: in expansion of macro ‘szqueue_pushq’
  649 |     list_head_init(szqueue_pushq(sq));
      |                    ^~~~~~~~~~~~~
thread_sync.c: In function ‘szqueue_ptr’:
eval_intern.h:172:64: warning: taking address of packed member of ‘struct rb_szqueue’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  172 | #define UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem)
eval_intern.h:170:40: note: in definition of macro ‘UNALIGNED_MEMBER_ACCESS’
  170 | # define UNALIGNED_MEMBER_ACCESS(expr) expr
      |                                        ^~~~
thread_sync.c:554:27: note: in expansion of macro ‘UNALIGNED_MEMBER_PTR’
  554 | #define szqueue_pushq(sq) UNALIGNED_MEMBER_PTR(sq, pushq)
      |                           ^~~~~~~~~~~~~~~~~~~~
thread_sync.c:660:24: note: in expansion of macro ‘szqueue_pushq’
  660 |         list_head_init(szqueue_pushq(sq));
      |                        ^~~~~~~~~~~~~
thread_sync.c: In function ‘rb_queue_initialize’:
thread_sync.c:761:24: warning: taking address of packed member of ‘struct rb_queue’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  761 |     RB_OBJ_WRITE(self, &q->que, ary_buf_new());
eval_intern.h:170:40: note: in definition of macro ‘UNALIGNED_MEMBER_ACCESS’
  170 | # define UNALIGNED_MEMBER_ACCESS(expr) expr
      |                                        ^~~~
thread_sync.c:761:5: note: in expansion of macro ‘RB_OBJ_WRITE’
  761 |     RB_OBJ_WRITE(self, &q->que, ary_buf_new());
      |     ^~~~~~~~~~~~
eval_intern.h:172:64: warning: taking address of packed member of ‘struct rb_queue’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  172 | #define UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem)
eval_intern.h:170:40: note: in definition of macro ‘UNALIGNED_MEMBER_ACCESS’
  170 | # define UNALIGNED_MEMBER_ACCESS(expr) expr
      |                                        ^~~~
thread_sync.c:545:24: note: in expansion of macro ‘UNALIGNED_MEMBER_PTR’
  545 | #define queue_waitq(q) UNALIGNED_MEMBER_PTR(q, waitq)
      |                        ^~~~~~~~~~~~~~~~~~~~
thread_sync.c:762:20: note: in expansion of macro ‘queue_waitq’
  762 |     list_head_init(queue_waitq(q));
      |                    ^~~~~~~~~~~
thread_sync.c: In function ‘queue_do_push’:
eval_intern.h:172:64: warning: taking address of packed member of ‘struct rb_queue’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  172 | #define UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem)
eval_intern.h:170:40: note: in definition of macro ‘UNALIGNED_MEMBER_ACCESS’
  170 | # define UNALIGNED_MEMBER_ACCESS(expr) expr
      |                                        ^~~~
thread_sync.c:545:24: note: in expansion of macro ‘UNALIGNED_MEMBER_PTR’
  545 | #define queue_waitq(q) UNALIGNED_MEMBER_PTR(q, waitq)
      |                        ^~~~~~~~~~~~~~~~~~~~
thread_sync.c:773:16: note: in expansion of macro ‘queue_waitq’
  773 |     wakeup_one(queue_waitq(q));
      |                ^~~~~~~~~~~
thread_sync.c: In function ‘rb_queue_close’:
eval_intern.h:172:64: warning: taking address of packed member of ‘struct rb_queue’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  172 | #define UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem)
eval_intern.h:170:40: note: in definition of macro ‘UNALIGNED_MEMBER_ACCESS’
  170 | # define UNALIGNED_MEMBER_ACCESS(expr) expr
      |                                        ^~~~
thread_sync.c:545:24: note: in expansion of macro ‘UNALIGNED_MEMBER_PTR’
  545 | #define queue_waitq(q) UNALIGNED_MEMBER_PTR(q, waitq)
      |                        ^~~~~~~~~~~~~~~~~~~~
thread_sync.c:818:20: note: in expansion of macro ‘queue_waitq’
  818 |         wakeup_all(queue_waitq(q));
      |                    ^~~~~~~~~~~
In file included from vm_core.h:77,
                 from eval_intern.h:5,
                 from thread.c:68:
thread_sync.c: In function ‘queue_do_pop’:
thread_sync.c:910:27: warning: taking address of packed member of ‘struct rb_queue’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  910 |             list_add_tail(&qw.as.q->waitq, &qw.w.node);
      |                           ^~~~~~~~~~~~~~~
ccan/list/list.h:195:44: note: in definition of macro ‘list_add_tail’
  195 | #define list_add_tail(h, n) list_add_tail_(h, n, LIST_LOC)
      |                                            ^
In file included from thread.c:68:
thread_sync.c: In function ‘rb_szqueue_initialize’:
thread_sync.c:1036:24: warning: taking address of packed member of ‘struct rb_queue’ may result in an unaligned pointer value [-Waddress-of-packed-member]
 1036 |     RB_OBJ_WRITE(self, &sq->q.que, ary_buf_new());
eval_intern.h:170:40: note: in definition of macro ‘UNALIGNED_MEMBER_ACCESS’
  170 | # define UNALIGNED_MEMBER_ACCESS(expr) expr
      |                                        ^~~~
thread_sync.c:1036:5: note: in expansion of macro ‘RB_OBJ_WRITE’
 1036 |     RB_OBJ_WRITE(self, &sq->q.que, ary_buf_new());
      |     ^~~~~~~~~~~~
eval_intern.h:172:64: warning: taking address of packed member of ‘struct rb_queue’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  172 | #define UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem)
eval_intern.h:170:40: note: in definition of macro ‘UNALIGNED_MEMBER_ACCESS’
  170 | # define UNALIGNED_MEMBER_ACCESS(expr) expr
      |                                        ^~~~
thread_sync.c:553:27: note: in expansion of macro ‘UNALIGNED_MEMBER_PTR’
  553 | #define szqueue_waitq(sq) UNALIGNED_MEMBER_PTR(sq, q.waitq)
      |                           ^~~~~~~~~~~~~~~~~~~~
thread_sync.c:1037:20: note: in expansion of macro ‘szqueue_waitq’
 1037 |     list_head_init(szqueue_waitq(sq));
      |                    ^~~~~~~~~~~~~
eval_intern.h:172:64: warning: taking address of packed member of ‘struct rb_szqueue’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  172 | #define UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem)

...

I have tried to install several versions of ruby (2.5.5, 2.6.6, 2.7.4, 3.0.0) and in all cases it has given the same error, of course with each version, in this example I only put the error for version 2.6.6:

 $ rvm use ruby --install --default 2.6.6
Required ruby-2.6.6 is not installed - installing.
ruby-2.6.6 - #removing src/ruby-2.6.6..
Searching for binary rubies, this might take some time.
No binary rubies available for: ubuntu/22.04/x86_64/ruby-2.6.6.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for ubuntu.
Requirements installation successful.
Installing Ruby from source to: /home/elorat/.rvm/rubies/ruby-2.6.6, this may take a while depending on your cpu(s)...
ruby-2.6.6 - #downloading ruby-2.6.6, this may take a while depending on your connection...
ruby-2.6.6 - #extracting ruby-2.6.6 to /home/elorat/.rvm/src/ruby-2.6.6.....
ruby-2.6.6 - #configuring......................................................................
ruby-2.6.6 - #post-configuration..
ruby-2.6.6 - #compiling..........................................................................................................-
Error running '__rvm_make -j4',
please read /home/elorat/.rvm/log/1652140330_ruby-2.6.6/make.log

There has been an error while running make. Halting the installation.

This is my work environment:

 $ rvm --version
rvm 1.29.12-next (master) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]

 $ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04 LTS
Release:    22.04
Codename:   jammy

UPDATE

I can't put the whole make.log file because the Body is limited to 30000 characters; the make.log file is 90138 characters long. I'm going to put the first 18788 characters.

this is part of the file make.log.

[2022-05-10 07:17:47] __rvm_make
__rvm_make () 
{ 
    \make "$@" || return $?
}
current path: /home/elorat/.rvm/src/ruby-2.6.6
GEM_PATH=/home/elorat/.rvm/gems/ruby-2.6.6:/home/elorat/.rvm/gems/ruby-2.6.6@global
PATH=/home/elorat/.rvm/gems/ruby-2.6.6/bin:/home/elorat/.rvm/gems/ruby-2.6.6@global/bin:/home/elorat/.rvm/rubies/ruby-2.6.6/bin:/home/elorat/.rvm/bin:/home/elorat/.nvm/versions/node/v12.22.9/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
command(2): __rvm_make -j4
++ make -j4
    BASERUBY = echo executable host ruby is required.  use --with-baseruby option.; false
    CC = gcc
    LD = ld
    LDSHARED = gcc -shared
    CFLAGS = -O3 -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wrestrict -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -std=gnu99  -fPIC 
    XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -fvisibility=hidden -fexcess-precision=standard -DRUBY_EXPORT -DCANONICALIZATION_FOR_MATHN
    CPPFLAGS =   -I. -I.ext/include/x86_64-linux -I./include -I. -I./enc/unicode/12.1.0 
    DLDFLAGS = -Wl,--compress-debug-sections=zlib -Wl,-soname,libruby.so.2.6  -fstack-protector-strong  
    SOLIBS = -lz -lpthread -lrt -lrt -lgmp -ldl -lcrypt -lm 
    LANG = en_US.UTF-8
    LC_ALL = 
    LC_CTYPE = 
gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

compiling ./main.c
compiling dmydln.c
compiling miniinit.c
compiling dmyext.c
compiling miniprelude.c
making dummy probes.h
compiling ast.c
compiling bignum.c
compiling class.c
compiling compar.c
In file included from ./include/ruby.h:33,
                 from internal.h:15,
                 from class.c:26:
class.c: In function ‘move_refined_method’:
class.c:955:30: warning: taking address of packed member of ‘struct rb_method_definition_struct’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  955 |             RB_OBJ_WRITE(me, &me->def->body.refined.orig_me, NULL);
./include/ruby/ruby.h:1493:75: note: in definition of macro ‘RB_OBJ_WRITE’
 1493 | #define RB_OBJ_WRITE(a, slot, b)       rb_obj_write((VALUE)(a), (VALUE *)(slot), (VALUE)(b), __FILE__, __LINE__)
      |                                                                           ^~~~
compiling compile.c
compile.c: In function ‘update_catch_except_flags’:
compile.c:1291:54: warning: taking address of packed member of ‘struct iseq_catch_table’ may result in an unaligned pointer value [-Waddress-of-packed-member]
 1291 |         const struct iseq_catch_table_entry *entry = &ct->entries[i];
      |                                                      ^~~~~~~~~~~~~~~
compile.c: In function ‘iseq_set_exception_table’:
compile.c:2356:21: warning: taking address of packed member of ‘struct iseq_catch_table’ may result in an unaligned pointer value [-Waddress-of-packed-member]
 2356 |             entry = &table->entries[i];
      |                     ^~~~~~~~~~~~~~~~~~
compiling complex.c
class.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
compiling cont.c
compiling debug.c
compiling debug_counter.c
compiling dir.c
compiling dln_find.c
compiling encoding.c
compiling enum.c
compiling enumerator.c
compiling error.c
compiling eval.c
compiling file.c
compiling gc.c
gc.c: In function ‘mark_current_machine_context’:
gc.c:4377:36: warning: expression does not compute the number of elements in this array; element type is ‘struct __jmp_buf_tag’, not ‘VALUE’ {aka ‘long unsigned int’} [-Wsizeof-array-div]
 4377 |         VALUE v[sizeof(rb_jmp_buf) / sizeof(VALUE)];
      |                                    ^
gc.c:4377:36: note: add parentheses around the second ‘sizeof’ to silence this warning
compiling hash.c
compiling inits.c
compile.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
compiling io.c
compiling iseq.c
iseq.c: In function ‘rb_iseq_mark’:
iseq.c:252:25: warning: taking address of packed member of ‘struct iseq_catch_table’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  252 |                 entry = &table->entries[i];
      |                         ^~~~~~~~~~~~~~~~~~
iseq.c: In function ‘rb_iseq_disasm_recursive’:
iseq.c:2067:58: warning: taking address of packed member of ‘struct iseq_catch_table’ may result in an unaligned pointer value [-Waddress-of-packed-member]
 2067 |             const struct iseq_catch_table_entry *entry = &body->catch_table->entries[i];
      |                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
iseq.c: In function ‘iseq_iterate_children’:
iseq.c:2200:58: warning: taking address of packed member of ‘struct iseq_catch_table’ may result in an unaligned pointer value [-Waddress-of-packed-member]
 2200 |             const struct iseq_catch_table_entry *entry = &body->catch_table->entries[i];
      |                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
iseq.c: In function ‘iseq_data_to_ary’:
iseq.c:2710:54: warning: taking address of packed member of ‘struct iseq_catch_table’ may result in an unaligned pointer value [-Waddress-of-packed-member]
 2710 |         const struct iseq_catch_table_entry *entry = &iseq_body->catch_table->entries[i];
      |                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compiling load.c
compiling marshal.c
gc.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
iseq.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
compiling math.c
making mjit_config.h
compiling mjit_compile.c
compiling node.c
compiling numeric.c
compiling object.c
compiling pack.c
compiling parse.c
compiling proc.c
compiling process.c
compiling random.c
compiling range.c
compiling rational.c
compiling re.c
compiling regcomp.c
compiling regenc.c
compiling regerror.c
compiling regexec.c
compiling regparse.c
compiling regsyntax.c
compiling ruby.c
compiling safe.c
compiling signal.c
compiling sprintf.c
compiling st.c
compiling strftime.c
strftime.c: In function ‘rb_strftime_with_timespec’:
strftime.c:386:39: warning: comparison is always false due to limited range of data type [-Wtype-limits]
  386 |                         if (vtm->wday < 0 || vtm->wday > 6)
      |                                       ^
strftime.c:397:39: warning: comparison is always false due to limited range of data type [-Wtype-limits]
  397 |                         if (vtm->wday < 0 || vtm->wday > 6)
      |                                       ^
compiling string.c
string.c: In function ‘str_replace_shared_without_enc’:
string.c:1189:13: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
 1189 |             char *ptr2 = STR_HEAP_PTR(str2);
      |             ^~~~
string.c: In function ‘rb_str_setbyte’:
string.c:5471:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
 5471 |     VALUE v = rb_to_int(value);
      |     ^~~~~
string.c: In function ‘get_reg_grapheme_cluster’:
string.c:8521:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
 8521 |         int r = onig_new(®_grapheme_cluster, source, source + source_len,
      |         ^~~
strftime.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
compiling struct.c
compiling symbol.c
compiling thread.c
In file included from thread.c:68:
thread_sync.c: In function ‘queue_alloc’:
eval_intern.h:172:64: warning: taking address of packed member of ‘struct rb_queue’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  172 | #define UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem)
eval_intern.h:170:40: note: in definition of macro ‘UNALIGNED_MEMBER_ACCESS’
  170 | # define UNALIGNED_MEMBER_ACCESS(expr) expr
      |                                        ^~~~
thread_sync.c:545:24: note: in expansion of macro ‘UNALIGNED_MEMBER_PTR’
  545 | #define queue_waitq(q) UNALIGNED_MEMBER_PTR(q, waitq)
      |                        ^~~~~~~~~~~~~~~~~~~~
thread_sync.c:590:20: note: in expansion of macro ‘queue_waitq’
  590 |     list_head_init(queue_waitq(q));
      |                    ^~~~~~~~~~~
thread_sync.c: In function ‘queue_fork_check’:
eval_intern.h:172:64: warning: taking address of packed member of ‘struct rb_queue’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  172 | #define UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem)
eval_intern.h:170:40: note: in definition of macro ‘UNALIGNED_MEMBER_ACCESS’
  170 | # define UNALIGNED_MEMBER_ACCESS(expr) expr
      |                                        ^~~~
thread_sync.c:545:24: note: in expansion of macro ‘UNALIGNED_MEMBER_PTR’
  545 | #define queue_waitq(q) UNALIGNED_MEMBER_PTR(q, waitq)
      |                        ^~~~~~~~~~~~~~~~~~~~
thread_sync.c:604:20: note: in expansion of macro ‘queue_waitq’
  604 |     list_head_init(queue_waitq(q));
      |                    ^~~~~~~~~~~
thread_sync.c: In function ‘szqueue_alloc’:
eval_intern.h:172:64: warning: taking address of packed member of ‘struct rb_queue’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  172 | #define UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem)
eval_intern.h:170:40: note: in definition of macro ‘UNALIGNED_MEMBER_ACCESS’
  170 | # define UNALIGNED_MEMBER_ACCESS(expr) expr
      |                                        ^~~~
thread_sync.c:553:27: note: in expansion of macro ‘UNALIGNED_MEMBER_PTR’
  553 | #define szqueue_waitq(sq) UNALIGNED_MEMBER_PTR(sq, q.waitq)
      |                           ^~~~~~~~~~~~~~~~~~~~
thread_sync.c:648:20: note: in expansion of macro ‘szqueue_waitq’
  648 |     list_head_init(szqueue_waitq(sq));
      |                    ^~~~~~~~~~~~~
eval_intern.h:172:64: warning: taking address of packed member of ‘struct rb_szqueue’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  172 | #define UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem)
eval_intern.h:170:40: note: in definition of macro ‘UNALIGNED_MEMBER_ACCESS’
  170 | # define UNALIGNED_MEMBER_ACCESS(expr) expr
      |                                        ^~~~
thread_sync.c:554:27: note: in expansion of macro ‘UNALIGNED_MEMBER_PTR’
  554 | #define szqueue_pushq(sq) UNALIGNED_MEMBER_PTR(sq, pushq)
      |                           ^~~~~~~~~~~~~~~~~~~~
thread_sync.c:649:20: note: in expansion of macro ‘szqueue_pushq’
  649 |     list_head_init(szqueue_pushq(sq));
      |                    ^~~~~~~~~~~~~
thread_sync.c: In function ‘szqueue_ptr’:
eval_intern.h:172:64: warning: taking address of packed member of ‘struct rb_szqueue’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  172 | #define UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem)
eval_intern.h:170:40: note: in definition of macro ‘UNALIGNED_MEMBER_ACCESS’
  170 | # define UNALIGNED_MEMBER_ACCESS(expr) expr
      |                                        ^~~~
thread_sync.c:554:27: note: in expansion of macro ‘UNALIGNED_MEMBER_PTR’
  554 | #define szqueue_pushq(sq) UNALIGNED_MEMBER_PTR(sq, pushq)
      |                           ^~~~~~~~~~~~~~~~~~~~
thread_sync.c:660:24: note: in expansion of macro ‘szqueue_pushq’
  660 |         list_head_init(szqueue_pushq(sq));
      |                        ^~~~~~~~~~~~~
thread_sync.c: In function ‘rb_queue_initialize’:
thread_sync.c:761:24: warning: taking address of packed member of ‘struct rb_queue’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  761 |     RB_OBJ_WRITE(self, &q->que, ary_buf_new());
eval_intern.h:170:40: note: in definition of macro ‘UNALIGNED_MEMBER_ACCESS’
  170 | # define UNALIGNED_MEMBER_ACCESS(expr) expr
      |                                        ^~~~
thread_sync.c:761:5: note: in expansion of macro ‘RB_OBJ_WRITE’
  761 |     RB_OBJ_WRITE(self, &q->que, ary_buf_new());
      |     ^~~~~~~~~~~~
eval_intern.h:172:64: warning: taking address of packed member of ‘struct rb_queue’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  172 | #define UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem)
eval_intern.h:170:40: note: in definition of macro ‘UNALIGNED_MEMBER_ACCESS’
  170 | # define UNALIGNED_MEMBER_ACCESS(expr) expr
      |                                        ^~~~
thread_sync.c:545:24: note: in expansion of macro ‘UNALIGNED_MEMBER_PTR’
  545 | #define queue_waitq(q) UNALIGNED_MEMBER_PTR(q, waitq)
      |                        ^~~~~~~~~~~~~~~~~~~~
thread_sync.c:762:20: note: in expansion of macro ‘queue_waitq’
  762 |     list_head_init(queue_waitq(q));
      |                    ^~~~~~~~~~~
thread_sync.c: In function ‘queue_do_push’:
eval_intern.h:172:64: warning: taking address of packed member of ‘struct rb_queue’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  172 | #define UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem)
eval_intern.h:170:40: note: in definition of macro ‘UNALIGNED_MEMBER_ACCESS’
  170 | # define UNALIGNED_MEMBER_ACCESS(expr) expr
      |                                        ^~~~
thread_sync.c:545:24: note: in expansion of macro ‘UNALIGNED_MEMBER_PTR’
  545 | #define queue_waitq(q) UNALIGNED_MEMBER_PTR(q, waitq)
      |                        ^~~~~~~~~~~~~~~~~~~~
thread_sync.c:773:16: note: in expansion of macro ‘queue_waitq’
  773 |     wakeup_one(queue_waitq(q));
      |                ^~~~~~~~~~~
thread_sync.c: In function ‘rb_queue_close’:
eval_intern.h:172:64: warning: taking address of packed member of ‘struct rb_queue’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  172 | #define UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem)
eval_intern.h:170:40: note: in definition of macro ‘UNALIGNED_MEMBER_ACCESS’
  170 | # define UNALIGNED_MEMBER_ACCESS(expr) expr
      |                                        ^~~~
thread_sync.c:545:24: note: in expansion of macro ‘UNALIGNED_MEMBER_PTR’
  545 | #define queue_waitq(q) UNALIGNED_MEMBER_PTR(q, waitq)
      |                        ^~~~~~~~~~~~~~~~~~~~
thread_sync.c:818:20: note: in expansion of macro ‘queue_waitq’
  818 |         wakeup_all(queue_waitq(q));
      |                    ^~~~~~~~~~~
In file included from vm_core.h:77,
                 from eval_intern.h:5,
                 from thread.c:68:
thread_sync.c: In function ‘queue_do_pop’:
thread_sync.c:910:27: warning: taking address of packed member of ‘struct rb_queue’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  910 |             list_add_tail(&qw.as.q->waitq, &qw.w.node);
      |                           ^~~~~~~~~~~~~~~
ccan/list/list.h:195:44: note: in definition of macro ‘list_add_tail’
  195 | #define list_add_tail(h, n) list_add_tail_(h, n, LIST_LOC)
      |                                            ^
In file included from thread.c:68:
thread_sync.c: In function ‘rb_szqueue_initialize’:
thread_sync.c:1036:24: warning: taking address of packed member of ‘struct rb_queue’ may result in an unaligned pointer value [-Waddress-of-packed-member]
 1036 |     RB_OBJ_WRITE(self, &sq->q.que, ary_buf_new());
eval_intern.h:170:40: note: in definition of macro ‘UNALIGNED_MEMBER_ACCESS’
  170 | # define UNALIGNED_MEMBER_ACCESS(expr) expr
      |                                        ^~~~
thread_sync.c:1036:5: note: in expansion of macro ‘RB_OBJ_WRITE’
 1036 |     RB_OBJ_WRITE(self, &sq->q.que, ary_buf_new());
      |     ^~~~~~~~~~~~
eval_intern.h:172:64: warning: taking address of packed member of ‘struct rb_queue’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  172 | #define UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem)
eval_intern.h:170:40: note: in definition of macro ‘UNALIGNED_MEMBER_ACCESS’
  170 | # define UNALIGNED_MEMBER_ACCESS(expr) expr
      |                                        ^~~~
thread_sync.c:553:27: note: in expansion of macro ‘UNALIGNED_MEMBER_PTR’
  553 | #define szqueue_waitq(sq) UNALIGNED_MEMBER_PTR(sq, q.waitq)
      |                           ^~~~~~~~~~~~~~~~~~~~
thread_sync.c:1037:20: note: in expansion of macro ‘szqueue_waitq’
 1037 |     list_head_init(szqueue_waitq(sq));
      |                    ^~~~~~~~~~~~~
eval_intern.h:172:64: warning: taking address of packed member of ‘struct rb_szqueue’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  172 | #define UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem)

...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

在风中等你 2025-02-03 15:27:43

看来您已经安装了OpenSSL 3.0(这是Ubuntu 22.04上唯一可用的OpenSSL版本)。

由于这是先前OpenSSL版本的重大更新,因此需要调整使用OpenSSL(包括Ruby)的许多库来使用OpenSSL的更改的API。 OpenSSL 3.0受支持从版本3.0.0.0 openssl gem的代码>,然后首先使用Ruby版本3.1.0发货。

因此,要能够在Ubuntu 22.04上安装Ruby的自定义版本(带有RBENV / RVM / RUBY-INSTALL),您必须至少使用Ruby 3.1.0。

ubuntu 22.04用 Ruby 3.0.2.2 您也可以使用。不幸的是,较旧的红宝石版本不直接支持。如果您需要在Ubuntu 22.04上使用较旧的Ruby版本,则还必须编译自定义OpenSSL 1.1.1,并根据此自定义OpenSSL编译Ruby。

It appears you have installed OpenSSL 3.0 (which is the only version of OpenSSL available on Ubuntu 22.04).

As this is a major update from previous OpenSSL versions, many libraries using OpenSSL (including Ruby) need to be adapted to use the changed APIs of OpenSSL. OpenSSL 3.0 is supported starting with version 3.0.0 of the openssl gem, which in turn was first shipped with Ruby version 3.1.0.

As such, to be able to install a custom version of Ruby on your Ubuntu 22.04 (with rbenv / rvm / ruby-install), you have to use at least Ruby 3.1.0.

Ubuntu 22.04 ships with a patched version of Ruby 3.0.2 which you may also use. Older Ruby versions are unfortunately not supported directly. If you need an older Ruby version on Ubuntu 22.04, you would also have to compile a custom OpenSSL 1.1.1 and compile Ruby against this custom OpenSSL.

睡美人的小仙女 2025-02-03 15:27:43

我无法在Ubuntu上安装Ruby 2.7.6 22.04

$ lsb_release -d
Description:    Ubuntu 22.04 LTS
$ rvm install ruby-2.7.6
...
ruby-2.7.6 - #extracting ruby-2.7.6 to /home/dgautier/.rvm/src/ruby-2.7.6 - please wait                                                                                                                                                                                         
ruby-2.7.6 - #configuring - please wait                                                                                                                                                                                                                                         
ruby-2.7.6 - #post-configuration - please wait                                                                                                                                                                                                                                  
ruby-2.7.6 - #compiling - please wait                                                                                                                                                                                                                                           
ruby-2.7.6 - #installing - please wait                                                                                                                                                                                                                                          
Error running '__rvm_make install',                                                                                                                                                                                                                                             
please read /home/kriom/.rvm/log/1654075018_ruby-2.7.6/install.log                                                                                                                                                       
There has been an error while running make install. Halting the installation.        
$ cat /home/kriom/.rvm/log/1654075018_ruby-2.7.6/install.log
installing default gems from lib:   /home/dgautier/.rvm/rubies/ruby-2.7.6/lib/ruby/gems/2.7.0 (build_info, cache, doc, extensions, gems, specifications)                                                                                                                        
                                    benchmark 0.1.0                                                                                                                                                                                                                             
/home/dgautier/.rvm/src/ruby-2.7.6/lib/rubygems/core_ext/kernel_require.rb:83:in `require': cannot load such file -- openssl (LoadError)                                                                                                                                        
        from /home/dgautier/.rvm/src/ruby-2.7.6/lib/rubygems/core_ext/kernel_require.rb:83:in `require'                                                                                                                                                                         
        from /home/dgautier/.rvm/src/ruby-2.7.6/lib/rubygems/specification.rb:2430:in `to_ruby'                                                                                                                                                                                 
        from ./tool/rbinstall.rb:846:in `block (2 levels) in install_default_gem'                                                                                                                                                                                               
        from ./tool/rbinstall.rb:279:in `open_for_install'                                                                                                                                                                                                                      
        from ./tool/rbinstall.rb:845:in `block in install_default_gem'                                                                                                                                                                                                          
        from ./tool/rbinstall.rb:835:in `each'                                                                                          
        from ./tool/rbinstall.rb:835:in `install_default_gem'                                                                                                                                                                                                                   
        from ./tool/rbinstall.rb:799:in `block in <main>'                                                                               
        from ./tool/rbinstall.rb:950:in `block in <main>'                                                                                                                                                                                                                       
        from ./tool/rbinstall.rb:947:in `each'                                                                                                                                                                                                                                  
        from ./tool/rbinstall.rb:947:in `<main>'                                                                                        
make: *** [uncommon.mk:380: do-install-nodoc] Error 1                                                                                                                                                                                                                           
++ return 2                                                                                                                             

此问题:

$ rvm pkg install openssl
$ rvm reinstall 2.7.6 --with-openssl-dir=/home/$(whoami)/.rvm/usr

I was unable to install ruby 2.7.6 on ubuntu 22.04

$ lsb_release -d
Description:    Ubuntu 22.04 LTS
$ rvm install ruby-2.7.6
...
ruby-2.7.6 - #extracting ruby-2.7.6 to /home/dgautier/.rvm/src/ruby-2.7.6 - please wait                                                                                                                                                                                         
ruby-2.7.6 - #configuring - please wait                                                                                                                                                                                                                                         
ruby-2.7.6 - #post-configuration - please wait                                                                                                                                                                                                                                  
ruby-2.7.6 - #compiling - please wait                                                                                                                                                                                                                                           
ruby-2.7.6 - #installing - please wait                                                                                                                                                                                                                                          
Error running '__rvm_make install',                                                                                                                                                                                                                                             
please read /home/kriom/.rvm/log/1654075018_ruby-2.7.6/install.log                                                                                                                                                       
There has been an error while running make install. Halting the installation.        
$ cat /home/kriom/.rvm/log/1654075018_ruby-2.7.6/install.log
installing default gems from lib:   /home/dgautier/.rvm/rubies/ruby-2.7.6/lib/ruby/gems/2.7.0 (build_info, cache, doc, extensions, gems, specifications)                                                                                                                        
                                    benchmark 0.1.0                                                                                                                                                                                                                             
/home/dgautier/.rvm/src/ruby-2.7.6/lib/rubygems/core_ext/kernel_require.rb:83:in `require': cannot load such file -- openssl (LoadError)                                                                                                                                        
        from /home/dgautier/.rvm/src/ruby-2.7.6/lib/rubygems/core_ext/kernel_require.rb:83:in `require'                                                                                                                                                                         
        from /home/dgautier/.rvm/src/ruby-2.7.6/lib/rubygems/specification.rb:2430:in `to_ruby'                                                                                                                                                                                 
        from ./tool/rbinstall.rb:846:in `block (2 levels) in install_default_gem'                                                                                                                                                                                               
        from ./tool/rbinstall.rb:279:in `open_for_install'                                                                                                                                                                                                                      
        from ./tool/rbinstall.rb:845:in `block in install_default_gem'                                                                                                                                                                                                          
        from ./tool/rbinstall.rb:835:in `each'                                                                                          
        from ./tool/rbinstall.rb:835:in `install_default_gem'                                                                                                                                                                                                                   
        from ./tool/rbinstall.rb:799:in `block in <main>'                                                                               
        from ./tool/rbinstall.rb:950:in `block in <main>'                                                                                                                                                                                                                       
        from ./tool/rbinstall.rb:947:in `each'                                                                                                                                                                                                                                  
        from ./tool/rbinstall.rb:947:in `<main>'                                                                                        
make: *** [uncommon.mk:380: do-install-nodoc] Error 1                                                                                                                                                                                                                           
++ return 2                                                                                                                             

This fix this issue :

$ rvm pkg install openssl
$ rvm reinstall 2.7.6 --with-openssl-dir=/home/$(whoami)/.rvm/usr
一身软味 2025-02-03 15:27:43

发出命令

rvm pkg install openssl

和观察输出

Extracting openssl to /usr/share/rvm/src/openssl-1.0.1i.....
Configuring openssl in /usr/share/rvm/src/openssl-1.0.1i.........
Compiling openssl in /usr/share/rvm/src/openssl-1.0.1i.....
Installing openssl to /usr/share/rvm/usr.................

,然后

rvm install 2.4.1 --with-openssl-dir=/usr/share/rvm/usr 

从输出安装openSSL获取的目录到/usr/share/rvm/usr

Issue command

rvm pkg install openssl

And watch output

Extracting openssl to /usr/share/rvm/src/openssl-1.0.1i.....
Configuring openssl in /usr/share/rvm/src/openssl-1.0.1i.........
Compiling openssl in /usr/share/rvm/src/openssl-1.0.1i.....
Installing openssl to /usr/share/rvm/usr.................

And then

rvm install 2.4.1 --with-openssl-dir=/usr/share/rvm/usr 

directory taken from output Installing openssl to /usr/share/rvm/usr

ぇ气 2025-02-03 15:27:43

运行RVMSUDO RVM PKG安装openssl

然后:

rvmsudo rvm install 2.5.1-with-openssl-dir =/usr/usr/share/rvm/rvm/usr

Run rvmsudo rvm pkg install openssl

then:

rvmsudo rvm install 2.5.1 --with-openssl-dir=/usr/share/rvm/usr

薄荷梦 2025-02-03 15:27:43

还面临此问题

在Ubuntu-22.04 Ruby-2.5及以下版本中,我也不支持Ubuntu-22.04中支持Ruby-2.6.5,在Ubuntu-22.04 Ruby-2.5及以下版本中安装Ruby-2.6.5时,

rvm get head

wget https://www.openssl.org/source/openssl-1.1.1g.tar.gz
tar zxvf openssl-1.1.1g.tar.gz

cd openssl-1.1.1g
./config --prefix=$HOME/.openssl/openssl-1.1.1g --openssldir=$HOME/.openssl/openssl-1.1.1g

make
make test
make install

rm -rf ~/.openssl/openssl-1.1.1g/certs
ln -s /etc/ssl/certs ~/.openssl/openssl-1.1.1g/certs

我 带有的版本 - 带有openssl-dir选项。
我安装了Ruby-2.6.5这样:

rvm reinstall ruby-2.6.5 --with-openssl-dir=$HOME/.openssl/openssl-1.1.1g

I am also facing this issue while installing ruby-2.6.5 through rvm in Ubuntu-22.04

ruby-2.5 and below versions are not supported in Ubuntu-22.04 so for that I found one solution to install openssl which support all ruby versions

rvm get head

wget https://www.openssl.org/source/openssl-1.1.1g.tar.gz
tar zxvf openssl-1.1.1g.tar.gz

cd openssl-1.1.1g
./config --prefix=$HOME/.openssl/openssl-1.1.1g --openssldir=$HOME/.openssl/openssl-1.1.1g

make
make test
make install

rm -rf ~/.openssl/openssl-1.1.1g/certs
ln -s /etc/ssl/certs ~/.openssl/openssl-1.1.1g/certs

Install any ruby version with --with-openssl-dir option.
I installed ruby-2.6.5 like this:

rvm reinstall ruby-2.6.5 --with-openssl-dir=$HOME/.openssl/openssl-1.1.1g
昔梦 2025-02-03 15:27:43

这些步骤对我有用

$ which openssl

,然后输出

/usr/local/bin/openssl

$ rvm install ruby-2.7.8 -C --with-openssl-dir=/usr/local/bin/openssl

These steps worked for me

$ which openssl

For me, it outputs

/usr/local/bin/openssl

Then,

$ rvm install ruby-2.7.8 -C --with-openssl-dir=/usr/local/bin/openssl
み青杉依旧 2025-02-03 15:27:43

由于您的错误未创建了high的teh gemset,请在一行中进行:

rvm use ruby-2.6.6 --install --default --create

或者,如果失败,请尝试:

ruby -v
rvm list
rvm install ruby-2.6.6
rvm use ruby-2.6.6 --default

As your errors highlited teh gemset not created, do in one line:

rvm use ruby-2.6.6 --install --default --create

or, if it fails, try:

ruby -v
rvm list
rvm install ruby-2.6.6
rvm use ruby-2.6.6 --default
忆梦 2025-02-03 15:27:43

问题是您使用的是22.04版本的Ubuntu,该版本仅包含3个版本的Openssl,但Ruby和Rails在SSL的1.1版本上运行,您可以降级Ubuntu版本或OpenSSL版本。我宁愿降级我的Ubuntu版本

The thing is that you are using the 22.04 version of ubuntu which contains only the openssl of version above 3 but ruby and rails runs on the version 1.1 of the ssl either u downgrade your ubuntu version or openssl version . I rather done downgrading my ubuntu version

别忘他 2025-02-03 15:27:43

为了解决此问题,我已删除了RVM并使用Ruby-Build,而是

为我提供技巧:

步骤1:安装所需的依赖项

sudo apt update
sudo apt install -y git curl autoconf bison build-essential libssl-dev libreadline-dev zlib1g-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev

步骤2:安装Ruby-Build

git clone https://github.com/rbenv/ruby-build.git
cd ruby-build
sudo ./install.sh

<强>步骤3:安装Ruby 2.7.5使用Ruby-Build

sudo ruby-build 2.7.5 /usr/local/ruby-2.7.5

步骤4:将Ruby添加到您的路径

echo 'export PATH="/usr/local/ruby-2.7.5/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

步骤5:验证安装

ruby -v

To fix this issue I have removed the RVM and use ruby-build instead

This do the trick for me:

Step 1: Install required dependencies

sudo apt update
sudo apt install -y git curl autoconf bison build-essential libssl-dev libreadline-dev zlib1g-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev

Step 2: Install ruby-build

git clone https://github.com/rbenv/ruby-build.git
cd ruby-build
sudo ./install.sh

Step 3: Install Ruby 2.7.5 using ruby-build

sudo ruby-build 2.7.5 /usr/local/ruby-2.7.5

Step 4: Add Ruby to your PATH

echo 'export PATH="/usr/local/ruby-2.7.5/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

Step 5: Verify the installation

ruby -v
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文