Can't build charlock_holmes native gem - ruby-on-rails

Trying to install and build native gem charlock_holmes version 0.7,3 with bundle install and getting an error. I believe I have all the dependencies but cannot figure out the error messages. Any help is appreciated.
I'm using Archlinux, ruby 3.0.0p0 and rubygems 3.2.3.
Stackoverflow is forcing me to add more stuff since it says "your post is mostly code", but there isn't much more to say about it... ¯_(ツ)_/¯
current directory: /home/kemel/.rvm/gems/ruby-3.0.0/gems/charlock_holmes-0.7.3/ext/charlock_holmes
/home/kemel/.rvm/rubies/ruby-3.0.0/bin/ruby -I /home/kemel/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0 -r ./siteconf20221027-431256-wyip6m.rb extconf.rb
checking for -licui18n... yes
checking for -licui18n... yes
checking for unicode/ucnv.h... yes
checking for -lz... yes
checking for -licuuc... yes
checking for -licudata... yes
creating Makefile
current directory: /home/kemel/.rvm/gems/ruby-3.0.0/gems/charlock_holmes-0.7.3/ext/charlock_holmes
make "DESTDIR=" clean
current directory: /home/kemel/.rvm/gems/ruby-3.0.0/gems/charlock_holmes-0.7.3/ext/charlock_holmes
make "DESTDIR="
compiling converter.c
In file included from converter.c:2:
common.h:32:14: warning: ‘charlock_new_str2’ defined but not used [-Wunused-function]
32 | static VALUE charlock_new_str2(const char *str)
| ^~~~~~~~~~~~~~~~~
common.h:23:14: warning: ‘charlock_new_str’ defined but not used [-Wunused-function]
23 | static VALUE charlock_new_str(const char *str, size_t len)
| ^~~~~~~~~~~~~~~~
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 encoding_detector.c
In file included from encoding_detector.c:2:
common.h:14:14: warning: ‘charlock_new_enc_str’ defined but not used [-Wunused-function]
14 | static VALUE charlock_new_enc_str(const char *str, size_t len, void *encoding)
| ^~~~~~~~~~~~~~~~~~~~
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 ext.c
In file included from ext.c:1:
common.h:32:14: warning: ‘charlock_new_str2’ defined but not used [-Wunused-function]
32 | static VALUE charlock_new_str2(const char *str)
| ^~~~~~~~~~~~~~~~~
common.h:23:14: warning: ‘charlock_new_str’ defined but not used [-Wunused-function]
23 | static VALUE charlock_new_str(const char *str, size_t len)
| ^~~~~~~~~~~~~~~~
common.h:14:14: warning: ‘charlock_new_enc_str’ defined but not used [-Wunused-function]
14 | static VALUE charlock_new_enc_str(const char *str, size_t len, void *encoding)
| ^~~~~~~~~~~~~~~~~~~~
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 transliterator.cpp
transliterator.cpp: In function ‘VALUE rb_transliterator_id_list(VALUE)’:
transliterator.cpp:39:3: error: ‘StringEnumeration’ was not declared in this scope; did you mean ‘icu_71::StringEnumeration’?
39 | StringEnumeration *id_list;
| ^~~~~~~~~~~~~~~~~
| icu_71::StringEnumeration
In file included from /usr/include/unicode/translit.h:30,
from transliterator.cpp:5:
/usr/include/unicode/strenum.h:61:20: note: ‘icu_71::StringEnumeration’ declared here
61 | class U_COMMON_API StringEnumeration : public UObject {
| ^~~~~~~~~~~~~~~~~
transliterator.cpp:39:22: error: ‘id_list’ was not declared in this scope; did you mean ‘va_list’?
39 | StringEnumeration *id_list;
| ^~~~~~~
| va_list
transliterator.cpp:47:13: error: ‘Transliterator’ has not been declared
47 | id_list = Transliterator::getAvailableIDs(status);
| ^~~~~~~~~~~~~~
transliterator.cpp:73:10: error: type ‘<type error>’ argument given to ‘delete’, expected pointer
73 | delete id_list;
| ^~~~~~~
transliterator.cpp: In function ‘VALUE rb_transliterator_transliterate(VALUE, VALUE, VALUE)’:
transliterator.cpp:81:3: error: ‘Transliterator’ was not declared in this scope; did you mean ‘icu_71::Transliterator’?
81 | Transliterator *trans;
| ^~~~~~~~~~~~~~
| icu_71::Transliterator
/usr/include/unicode/translit.h:490:18: note: ‘icu_71::Transliterator’ declared here
490 | class U_I18N_API Transliterator : public UObject {
| ^~~~~~~~~~~~~~
transliterator.cpp:81:19: error: ‘trans’ was not declared in this scope
81 | Transliterator *trans;
| ^~~~~
transliterator.cpp:86:3: error: ‘UnicodeString’ was not declared in this scope; did you mean ‘icu_71::UnicodeString’?
86 | UnicodeString *u_txt;
| ^~~~~~~~~~~~~
| icu_71::UnicodeString
In file included from /usr/include/unicode/translit.h:27:
/usr/include/unicode/unistr.h:295:20: note: ‘icu_71::UnicodeString’ declared here
295 | class U_COMMON_API UnicodeString : public Replaceable
| ^~~~~~~~~~~~~
transliterator.cpp:86:18: error: ‘u_txt’ was not declared in this scope; did you mean ‘txt’?
86 | UnicodeString *u_txt;
| ^~~~~
| txt
transliterator.cpp:101:11: error: ‘Transliterator’ is not a class, namespace, or enumeration
101 | trans = Transliterator::createInstance(UnicodeString(id, id_len), UTRANS_FORWARD, p_error, status);
| ^~~~~~~~~~~~~~
transliterator.cpp:106:15: error: expected type-specifier before ‘UnicodeString’
106 | u_txt = new UnicodeString(txt, txt_len);
| ^~~~~~~~~~~~~
transliterator.cpp:108:3: error: ‘StringByteSink’ was not declared in this scope; did you mean ‘icu_71::StringByteSink’?
108 | StringByteSink<std::string> sink(&result);
| ^~~~~~~~~~~~~~
| icu_71::StringByteSink
In file included from /usr/include/unicode/unistr.h:40:
/usr/include/unicode/bytestream.h:267:7: note: ‘icu_71::StringByteSink’ declared here
267 | class StringByteSink : public ByteSink {
| ^~~~~~~~~~~~~~
transliterator.cpp:108:29: error: expected primary-expression before ‘>’ token
108 | StringByteSink<std::string> sink(&result);
| ^
transliterator.cpp:108:31: error: ‘sink’ was not declared in this scope; did you mean ‘sinl’?
108 | StringByteSink<std::string> sink(&result);
| ^~~~
| sinl
transliterator.cpp:111:10: error: type ‘<type error>’ argument given to ‘delete’, expected pointer
111 | delete u_txt;
| ^~~~~
transliterator.cpp:112:10: error: type ‘<type error>’ argument given to ‘delete’, expected pointer
112 | delete trans;
| ^~~~~
make: *** [Makefile:237: transliterator.o] Erro 1
make failed, exit code 2

Related

Error '__rvm_make -j4' when trying to install Ruby through RVM

I am in a full stack developer bootcamp and we need to install Ruby on Rails. So far I have enabled the "Windows Subsystem for Linux" feature, installed WSL 2, installed Ubuntu, and installed curl, pnupg and git.
I am trying to install RVM using this command:
curl -sSL https://get.rvm.io | bash -s stable --ruby
but I keep getting Error running '__rvm_make -j4'
I am using Windows 10 Home.
Here is an abbreviated form of the log file. There were many more warnings about functions being deprecated since 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)
Just in case someone else stumbles across this question, the answer can be found in the answers to this Github issue. Even though there are a few similar bug reports with similar answers exists for Ubuntu, this looks like the most direct.
$rvm pkg install openssl
$rvm install ruby-<version> --with-openssl-dir=/usr/share/rvm/usr

Error running '__rvm_make -j8' when trying to install ruby 2.6.2 on Ubuntu 22.4 [duplicate]

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(&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)
...
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.0.4 (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.
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
Run rvmsudo rvm pkg install openssl
then:
rvmsudo rvm install 2.5.1 --with-openssl-dir=/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
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
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
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

Ubuntu Sqlite3 1.4.2 gem install error. Any ideas?

I installed libsqlite3-dev but it hasn't helped. My ruby version is 3.0.0 .And this is my error :
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /home/nurlaney/.gem/gems/sqlite3-1.4.2/ext/sqlite3
/snap/ruby/201/bin/ruby -I /snap/ruby/201/lib/ruby/3.0.0 -r ./siteconf20210129-26408-4tihlx.rb extconf.rb
checking for sqlite3.h... yes
checking for pthread_create() in -lpthread... yes
checking for -ldl... yes
checking for sqlite3_libversion_number() in -lsqlite3... yes
checking for rb_proc_arity()... no
checking for rb_integer_pack()... no
checking for sqlite3_initialize()... yes
checking for sqlite3_backup_init()... yes
checking for sqlite3_column_database_name()... yes
checking for sqlite3_enable_load_extension()... yes
checking for sqlite3_load_extension()... yes
checking for sqlite3_open_v2()... yes
checking for sqlite3_prepare_v2()... yes
checking for sqlite3_int64 in sqlite3.h... yes
checking for sqlite3_uint64 in sqlite3.h... yes
creating Makefile
current directory: /home/nurlaney/.gem/gems/sqlite3-1.4.2/ext/sqlite3
make "DESTDIR=" clean
current directory: /home/nurlaney/.gem/gems/sqlite3-1.4.2/ext/sqlite3
make "DESTDIR="
compiling aggregator.c
compiling backup.c
compiling database.c
database.c: In function ‘rb_sqlite3_open_v2’:
database.c:38:9: warning: unused variable ‘flags’ [-Wunused-variable]
38 | VALUE flags;
| ^~~~~
database.c: In function ‘exec_batch’:
database.c:726:57: warning: passing argument 3 of ‘sqlite3_exec’ from incompatible pointer type
[-Wincompatible-pointer-types]
726 | status = sqlite3_exec(ctx->db, StringValuePtr(sql), hash_callback_function, callback_ary, &errMsg);
| ^~~~~~~~~~~~~~~~~~~~~~
| |
| int (*)(VALUE, int, char **, char **) {aka int
(*)(long unsigned int, int, char **, char **)}
In file included from ./sqlite3_ruby.h:25,
from database.c:1:
/usr/include/sqlite3.h:409:9: note: expected ‘int (*)(void *, int, char **, char **)’ but argument is of type ‘int
(*)(VALUE, int, char **, char **)’ {aka ‘int (*)(long unsigned int, int, char **, char **)’}
409 | int (*callback)(void*,int,char**,char**), /* Callback function */
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
database.c:726:81: warning: passing argument 4 of ‘sqlite3_exec’ makes pointer from integer without a cast
[-Wint-conversion]
726 | status = sqlite3_exec(ctx->db, StringValuePtr(sql), hash_callback_function, callback_ary, &errMsg);
| ^~~~~~~~~~~~
| |
| VALUE {aka long unsigned int}
In file included from ./sqlite3_ruby.h:25,
from database.c:1:
/usr/include/sqlite3.h:410:3: note: expected ‘void *’ but argument is of type ‘VALUE’ {aka ‘long unsigned int’}
410 | void *, /* 1st argument to callback */
| ^~~~~~
database.c:728:57: warning: passing argument 3 of ‘sqlite3_exec’ from incompatible pointer type
[-Wincompatible-pointer-types]
728 | status = sqlite3_exec(ctx->db, StringValuePtr(sql), regular_callback_function, callback_ary, &errMsg);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
| |
| int (*)(VALUE, int, char **, char **) {aka int
(*)(long unsigned int, int, char **, char **)}
In file included from ./sqlite3_ruby.h:25,
from database.c:1:
/usr/include/sqlite3.h:409:9: note: expected ‘int (*)(void *, int, char **, char **)’ but argument is of type ‘int
(*)(VALUE, int, char **, char **)’ {aka ‘int (*)(long unsigned int, int, char **, char **)’}
409 | int (*callback)(void*,int,char**,char**), /* Callback function */
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
database.c:728:84: warning: passing argument 4 of ‘sqlite3_exec’ makes pointer from integer without a cast
[-Wint-conversion]
728 | status = sqlite3_exec(ctx->db, StringValuePtr(sql), regular_callback_function, callback_ary, &errMsg);
| ^~~~~~~~~~~~
| |
| VALUE {aka long unsigned
int}
In file included from ./sqlite3_ruby.h:25,
from database.c:1:
/usr/include/sqlite3.h:410:3: note: expected ‘void *’ but argument is of type ‘VALUE’ {aka ‘long unsigned int’}
410 | void *, /* 1st argument to callback */
| ^~~~~~
database.c: At top level:
cc1: warning: unrecognized command line option ‘-Wno-self-assign’
cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
compiling exception.c
compiling sqlite3.c
sqlite3.c: In function ‘bignum_to_int64’:
sqlite3.c:33:27: warning: implicit declaration of function ‘RBIGNUM’; did you mean ‘T_BIGNUM’?
[-Wimplicit-function-declaration]
33 | # define RBIGNUM_LEN(x) RBIGNUM(x)->len
| ^~~~~~~
sqlite3.c:35:20: note: in expansion of macro ‘RBIGNUM_LEN’
35 | const long len = RBIGNUM_LEN(value);
| ^~~~~~~~~~~
sqlite3.c:33:37: error: invalid type argument of ‘->’ (have ‘int’)
33 | # define RBIGNUM_LEN(x) RBIGNUM(x)->len
| ^~
sqlite3.c:35:20: note: in expansion of macro ‘RBIGNUM_LEN’
35 | const long len = RBIGNUM_LEN(value);
| ^~~~~~~~~~~
sqlite3.c:40:19: error: ‘SIZEOF_BDIGITS’ undeclared (first use in this function); did you mean ‘SIZEOF_INT’?
40 | if (len > 63 / (SIZEOF_BDIGITS * CHAR_BIT) + 1) return 0;
| ^~~~~~~~~~~~~~
| SIZEOF_INT
sqlite3.c:40:19: note: each undeclared identifier is reported only once for each function it appears in
sqlite3.c:42:11: error: unknown type name ‘BDIGIT’
42 | const BDIGIT *digits = RBIGNUM_DIGITS(value);
| ^~~~~~
sqlite3.c:42:28: warning: implicit declaration of function ‘RBIGNUM_DIGITS’; did you mean ‘RBIGNUM_SIGN’?
[-Wimplicit-function-declaration]
42 | const BDIGIT *digits = RBIGNUM_DIGITS(value);
| ^~~~~~~~~~~~~~
| RBIGNUM_SIGN
sqlite3.c:42:28: warning: initialization of ‘const int *’ from ‘int’ makes pointer from integer without a cast
[-Wint-conversion]
sqlite3.c:43:5: error: unknown type name ‘BDIGIT’; did you mean ‘ISDIGIT’?
43 | BDIGIT blast = digits[len-1];
| ^~~~~~
| ISDIGIT
sqlite3.c:44:5: error: unknown type name ‘BDIGIT’; did you mean ‘ISDIGIT’?
44 | BDIGIT bmax = (BDIGIT)1UL << (63 % (CHAR_BIT * SIZEOF_BDIGITS));
| ^~~~~~
| ISDIGIT
sqlite3.c:44:20: error: ‘BDIGIT’ undeclared (first use in this function); did you mean ‘ISDIGIT’?
44 | BDIGIT bmax = (BDIGIT)1UL << (63 % (CHAR_BIT * SIZEOF_BDIGITS));
| ^~~~~~
| ISDIGIT
sqlite3.c:44:27: error: expected ‘,’ or ‘;’ before numeric constant
44 | BDIGIT bmax = (BDIGIT)1UL << (63 % (CHAR_BIT * SIZEOF_BDIGITS));
| ^~~
sqlite3.c: At top level:
cc1: warning: unrecognized command line option ‘-Wno-self-assign’
cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
make: *** [Makefile:245: sqlite3.o] Error 1
make failed, exit code 2
Gem files will remain installed in /home/nurlaney/.gem/gems/sqlite3-1.4.2 for inspection.
Results logged to /home/nurlaney/.gem/extensions/x86_64-linux/3.0.0/sqlite3-1.4.2/gem_make.out
An error occurred while installing sqlite3 (1.4.2), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.4.2' --source 'http://rubygems.org/'` succeeds before bundling.
In Gemfile:
sqlite3
I looked at other topics and none of them helped. Should i install DevKit like in Windows ? And if this can install, how is it ?
I installed ruby from snap channel.
I tried install sqlite3 gem but it returns me same error again. Then i tried to install gem locally but it doesnt help again. So im stuck. I don't know how to fix. Any ideas ?
Please check following simple steps for install sqlite3 in Ubuntu 20.04
sudo apt update
sudo apt install sqlite3
sqlite3 --version
If above comment not working for your machine, you can directly download the .deb file here and install https://ubuntu.pkgs.org/20.04/ubuntu-main-amd64/libsqlite3-dev_3.31.1-4_amd64.deb.html
Install sqlite3 Gem
sudo apt-get install sqlite3 libsqlite3-dev
sudo gem install sqlite3-ruby
Let me if you need any help thanks :)

mysql2 Ruby Gem failed to install ubuntu 20.04

Does anyone know what causes this and how I can fix it? I am trying to install a ruby gem for my project which is an old project running on rails 3, but I'm running on ubuntu 20.04. All I am doing is essentially running bundle install and then I get everything else working except this ruby gem. Please advise!
current directory: /home/decil/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/mysql2-0.3.21/ext/mysql2
make "DESTDIR=" clean
current directory: /home/decil/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/mysql2-0.3.21/ext/mysql2
make "DESTDIR="
compiling client.c
client.c: In function ‘nogvl_read_query_result’:
client.c:439:3: error: unknown type name ‘my_bool’; did you mean ‘bool’?
439 | my_bool res = mysql_read_query_result(client);
| ^~~~~~~
| bool
client.c: In function ‘rb_query’:
client.c:687:14: warning: passing argument 1 of ‘rb_rescue2’ from incompatible pointer type [-Wincompatible-pointer-types]
687 | rb_rescue2(do_send_query, (VALUE)&args, disconnect_and_raise, self, rb_eException, (VALUE)0);
| ^~~~~~~~~~~~~
| |
| VALUE (*)(void *) {aka long unsigned int (*)(void *)}
In file included from /home/decil/.rbenv/versions/2.7.1/include/ruby-2.7.0/ruby.h:33,
from ./mysql2_ext.h:8,
from client.c:1:
/home/decil/.rbenv/versions/2.7.1/include/ruby-2.7.0/ruby/ruby.h:1988:18: note: expected ‘VALUE (*)(VALUE)’ {aka ‘long unsigned int (*)(long unsigned int)’} but argument is of type ‘VALUE (*)(void *)’ {aka ‘long unsigned int (*)(void *)’}
1988 | VALUE rb_rescue2(VALUE(*)(VALUE),VALUE,VALUE(*)(VALUE,VALUE),VALUE,...);
| ^~~~~~~~~~~~~~~
client.c:695:16: warning: passing argument 1 of ‘rb_rescue2’ from incompatible pointer type [-Wincompatible-pointer-types]
695 | rb_rescue2(do_query, (VALUE)&async_args, disconnect_and_raise, self, rb_eException, (VALUE)0);
| ^~~~~~~~
| |
| VALUE (*)(void *) {aka long unsigned int (*)(void *)}
In file included from /home/decil/.rbenv/versions/2.7.1/include/ruby-2.7.0/ruby.h:33,
from ./mysql2_ext.h:8,
from client.c:1:
/home/decil/.rbenv/versions/2.7.1/include/ruby-2.7.0/ruby/ruby.h:1988:18: note: expected ‘VALUE (*)(VALUE)’ {aka ‘long unsigned int (*)(long unsigned int)’} but argument is of type ‘VALUE (*)(void *)’ {aka ‘long unsigned int (*)(void *)’}
1988 | VALUE rb_rescue2(VALUE(*)(VALUE),VALUE,VALUE(*)(VALUE,VALUE),VALUE,...);
| ^~~~~~~~~~~~~~~
client.c: In function ‘_mysql_client_options’:
client.c:762:3: error: unknown type name ‘my_bool’; did you mean ‘bool’?
762 | my_bool boolval;
| ^~~~~~~
| bool
client.c:797:10: error: ‘MYSQL_SECURE_AUTH’ undeclared (first use in this function); did you mean ‘MYSQL_DEFAULT_AUTH’?
797 | case MYSQL_SECURE_AUTH:
| ^~~~~~~~~~~~~~~~~
| MYSQL_DEFAULT_AUTH
client.c:797:10: note: each undeclared identifier is reported only once for each function it appears in
client.c: In function ‘set_secure_auth’:
client.c:1185:38: error: ‘MYSQL_SECURE_AUTH’ undeclared (first use in this function); did you mean ‘MYSQL_DEFAULT_AUTH’?
1185 | return _mysql_client_options(self, MYSQL_SECURE_AUTH, value);
| ^~~~~~~~~~~~~~~~~
| MYSQL_DEFAULT_AUTH
client.c:1186:1: warning: control reaches end of non-void function [-Wreturn-type]
1186 | }
| ^
client.c: At top level:
cc1: warning: unrecognized command line option ‘-Wno-self-assign’
cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
make: *** [Makefile:245: client.o] Error 1
I had a similar issue with version 0.4.5, It worked fine for me with version 0.4.10
Try with the below on your Gemfile:
gem 'mysql2', '0.4.10'
The latest version of the mysql2 gem compatible with Rails 3 is v0.3.21 (source).
mysql2 gem v0.3.21 depends on the my_bool datatype in MySQL itself.
MySQL 5.7 has the my_bool datatype but it was removed in MySQL 8.0 (source).
Ubuntu 20.04 does not have MySQL 5.7, only 8.0+ (source).
Therefore you need to install MySQL 5.7 from MySQL's own apt repositories and stop your server from installing any MySQL stuff from Ubuntu's apt repositories.
I just did all this and successfully got a Rails 3.2 app running on Ubuntu 20.04 LTS.
(Also, Rails 3.2.x is only compatible with Ruby <= 2.3.x.)
my env:ruby2.3,rails3,ubuntu20 server
first of all uninstall mysql5.8, and install mysql5.7
you can see this
enter link description here
but the most important is that make sure the libmysqlclient-dev's version before you install gem mysql2'0.3.11' .
the default libmysqlclient-dev's version is 8.0
i download the
libmysqlclient20_5.7.35-1ubuntu18.04_amd64.deb
libmysqlclient-dev_5.7.35-1ubuntu18.04_amd64.deb
and install them sudo dpkg -i them
that ok

Error installing rails: ERROR: Failed to build gem native extension. Ubuntu 20.04

When I ran this command:
gem install rails
I got this output:
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
current directory: /home/hizmarck/.rvm/gems/ruby-2.7.1/gems/nokogiri-1.10.9/ext/nokogiri
/usr/share/rvm/rubies/ruby-2.7.1/bin/ruby -I /usr/share/rvm/rubies/ruby-2.7.1/lib/ruby/site_ruby/2.7.0 -r ./siteconf20200602-62149-hwdwns.rb extconf.rb
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
Using mini_portile version 2.4.0
checking for gzdopen() in -lz... yes
checking for iconv... yes
************************************************************************
IMPORTANT NOTICE:
Building Nokogiri with a packaged version of libxml2-2.9.10
with the following patches applied:
- 0001-Revert-Do-not-URI-escape-in-server-side-includes.patch
- 0002-Remove-script-macro-support.patch
- 0003-Update-entities-to-remove-handling-of-ssi.patch
- 0004-libxml2.la-is-in-top_builddir.patch
- 0005-Fix-infinite-loop-in-xmlStringLenDecodeEntities.patch
Team Nokogiri will keep on doing their best to provide security
updates in a timely manner, but if this is a concern for you and want
to use the system library instead; abort this installation process and
reinstall nokogiri as follows:
gem install nokogiri -- --use-system-libraries
[--with-xml2-config=/path/to/xml2-config]
[--with-xslt-config=/path/to/xslt-config]
If you are using Bundler, tell it to use the option:
bundle config build.nokogiri --use-system-libraries
bundle install
Note, however, that nokogiri is not fully compatible with arbitrary
versions of libxml2 provided by OS/package vendors.
************************************************************************
Extracting libxml2-2.9.10.tar.gz into tmp/x86_64-pc-linux-gnu/ports/libxml2/2.9.10... OK
Running git apply with /home/hizmarck/.rvm/gems/ruby-2.7.1/gems/nokogiri-1.10.9/patches/libxml2/0001-Revert-Do-not-URI-escape-in-server-side-includes.patch... OK
Running git apply with /home/hizmarck/.rvm/gems/ruby-2.7.1/gems/nokogiri-1.10.9/patches/libxml2/0002-Remove-script-macro-support.patch... OK
Running git apply with /home/hizmarck/.rvm/gems/ruby-2.7.1/gems/nokogiri-1.10.9/patches/libxml2/0003-Update-entities-to-remove-handling-of-ssi.patch... OK
Running git apply with /home/hizmarck/.rvm/gems/ruby-2.7.1/gems/nokogiri-1.10.9/patches/libxml2/0004-libxml2.la-is-in-top_builddir.patch... OK
Running git apply with /home/hizmarck/.rvm/gems/ruby-2.7.1/gems/nokogiri-1.10.9/patches/libxml2/0005-Fix-infinite-loop-in-xmlStringLenDecodeEntities.patch... OK
Running 'configure' for libxml2 2.9.10... OK
Running 'compile' for libxml2 2.9.10... OK
Running 'install' for libxml2 2.9.10... OK
Activating libxml2 2.9.10 (from /home/hizmarck/.rvm/gems/ruby-2.7.1/gems/nokogiri-1.10.9/ports/x86_64-pc-linux-gnu/libxml2/2.9.10)...
************************************************************************
IMPORTANT NOTICE:
Building Nokogiri with a packaged version of libxslt-1.1.34.
Team Nokogiri will keep on doing their best to provide security
updates in a timely manner, but if this is a concern for you and want
to use the system library instead; abort this installation process and
reinstall nokogiri as follows:
gem install nokogiri -- --use-system-libraries
[--with-xml2-config=/path/to/xml2-config]
[--with-xslt-config=/path/to/xslt-config]
If you are using Bundler, tell it to use the option:
bundle config build.nokogiri --use-system-libraries
bundle install
************************************************************************
Extracting libxslt-1.1.34.tar.gz into tmp/x86_64-pc-linux-gnu/ports/libxslt/1.1.34... OK
Running 'configure' for libxslt 1.1.34... OK
Running 'compile' for libxslt 1.1.34... OK
Running 'install' for libxslt 1.1.34... OK
Activating libxslt 1.1.34 (from /home/hizmarck/.rvm/gems/ruby-2.7.1/gems/nokogiri-1.10.9/ports/x86_64-pc-linux-gnu/libxslt/1.1.34)...
checking for -llzma... yes
checking for xmlParseDoc() in libxml/parser.h... yes
checking for xsltParseStylesheetDoc() in libxslt/xslt.h... yes
checking for exsltFuncRegister() in libexslt/exslt.h... yes
checking for xmlHasFeature()... yes
checking for xmlFirstElementChild()... yes
checking for xmlRelaxNGSetParserStructuredErrors()... yes
checking for xmlRelaxNGSetParserStructuredErrors()... yes
checking for xmlRelaxNGSetValidStructuredErrors()... yes
checking for xmlSchemaSetValidStructuredErrors()... yes
checking for xmlSchemaSetParserStructuredErrors()... yes
creating Makefile
current directory: /home/hizmarck/.rvm/gems/ruby-2.7.1/gems/nokogiri-1.10.9/ext/nokogiri
make "DESTDIR=" clean
current directory: /home/hizmarck/.rvm/gems/ruby-2.7.1/gems/nokogiri-1.10.9/ext/nokogiri
make "DESTDIR="
compiling html_document.c
In file included from /usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby.h:33,
from ./nokogiri.h:33,
from ./html_document.h:4,
from html_document.c:1:
html_document.c: In function ‘new’:
/usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:2508:48: warning: cast discards ‘const’ qualifier from pointer target type [-Wcast-qual]
2508 | (rb_scan_args_verify(fmt, varc), vars), (char *)fmt, varc)
| ^
/usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:2340:9: note: in expansion of macro ‘rb_scan_args0’
2340 | rb_scan_args0(argc,argvp,fmt,\
| ^~~~~~~~~~~~~
html_document.c:16:3: note: in expansion of macro ‘rb_scan_args’
16 | rb_scan_args(argc, argv, "0*", &rest);
| ^~~~~~~~~~~~
html_document.c: At top level:
cc1: warning: unrecognized command line option ‘-Wno-self-assign’
cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
compiling html_element_description.c
compiling html_entity_lookup.c
compiling html_sax_parser_context.c
compiling html_sax_push_parser.c
compiling nokogiri.c
compiling xml_attr.c
In file included from /usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby.h:33,
from ./nokogiri.h:33,
from ./xml_attr.h:4,
from xml_attr.c:1:
xml_attr.c: In function ‘new’:
/usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:2508:48: warning: cast discards ‘const’ qualifier from pointer target type [-Wcast-qual]
2508 | (rb_scan_args_verify(fmt, varc), vars), (char *)fmt, varc)
| ^
/usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:2340:9: note: in expansion of macro ‘rb_scan_args0’
2340 | rb_scan_args0(argc,argvp,fmt,\
| ^~~~~~~~~~~~~
xml_attr.c:61:3: note: in expansion of macro ‘rb_scan_args’
61 | rb_scan_args(argc, argv, "2*", &document, &name, &rest);
| ^~~~~~~~~~~~
xml_attr.c: At top level:
cc1: warning: unrecognized command line option ‘-Wno-self-assign’
cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
compiling xml_attribute_decl.c
compiling xml_cdata.c
In file included from /usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby.h:33,
from ./nokogiri.h:33,
from ./xml_cdata.h:4,
from xml_cdata.c:1:
xml_cdata.c: In function ‘new’:
/usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:2508:48: warning: cast discards ‘const’ qualifier from pointer target type [-Wcast-qual]
2508 | (rb_scan_args_verify(fmt, varc), vars), (char *)fmt, varc)
| ^
/usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:2340:9: note: in expansion of macro ‘rb_scan_args0’
2340 | rb_scan_args0(argc,argvp,fmt,\
| ^~~~~~~~~~~~~
xml_cdata.c:23:3: note: in expansion of macro ‘rb_scan_args’
23 | rb_scan_args(argc, argv, "2*", &doc, &content, &rest);
| ^~~~~~~~~~~~
xml_cdata.c: At top level:
cc1: warning: unrecognized command line option ‘-Wno-self-assign’
cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
compiling xml_comment.c
In file included from /usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby.h:33,
from ./nokogiri.h:33,
from ./xml_comment.h:4,
from xml_comment.c:1:
xml_comment.c: In function ‘new’:
/usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:2508:48: warning: cast discards ‘const’ qualifier from pointer target type [-Wcast-qual]
2508 | (rb_scan_args_verify(fmt, varc), vars), (char *)fmt, varc)
| ^
/usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:2340:9: note: in expansion of macro ‘rb_scan_args0’
2340 | rb_scan_args0(argc,argvp,fmt,\
| ^~~~~~~~~~~~~
xml_comment.c:21:3: note: in expansion of macro ‘rb_scan_args’
21 | rb_scan_args(argc, argv, "2*", &document, &content, &rest);
| ^~~~~~~~~~~~
xml_comment.c: At top level:
cc1: warning: unrecognized command line option ‘-Wno-self-assign’
cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
compiling xml_document.c
xml_document.c: In function ‘dealloc’:
xml_document.c:49:25: warning: passing argument 2 of ‘rb_st_foreach’ from incompatible pointer type [-Wincompatible-pointer-types]
49 | st_foreach(node_hash, dealloc_node_i, (st_data_t)doc);
| ^~~~~~~~~~~~~~
| |
| int (*)(xmlNode *, xmlNode *, xmlDoc *) {aka int (*)(struct _xmlNode *, struct _xmlNode *, struct _xmlDoc *)}
In file included from /usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/intern.h:39,
from /usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:2148,
from /usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby.h:33,
from ./nokogiri.h:33,
from ./xml_document.h:4,
from xml_document.c:1:
/usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/st.h:141:31: note: expected ‘int (*)(st_data_t, st_data_t, st_data_t)’ {aka ‘int
...
| ^~~~~~~~~~~~
xml_document.c: At top level:
cc1: warning: unrecognized command line option ‘-Wno-self-assign’
cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
compiling xml_document_fragment.c
In file included from /usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby.h:33,
from ./nokogiri.h:33,
from ./xml_document_fragment.h:4,
from xml_document_fragment.c:1:
xml_document_fragment.c: In function ‘new’:
/usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:2508:48: warning: cast discards ‘const’ qualifier from pointer target type [-Wcast-qual]
2508 | (rb_scan_args_verify(fmt, varc), vars), (char *)fmt, varc)
| ^
/usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:2340:9: note: in expansion of macro ‘rb_scan_args0’
2340 | rb_scan_args0(argc,argvp,fmt,\
| ^~~~~~~~~~~~~
xml_document_fragment.c:17:3: note: in expansion of macro ‘rb_scan_args’
17 | rb_scan_args(argc, argv, "1*", &document, &rest);
| ^~~~~~~~~~~~
xml_document_fragment.c: At top level:
cc1: warning: unrecognized command line option ‘-Wno-self-assign’
cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
compiling xml_dtd.c
compiling xml_element_content.c
compiling xml_element_decl.c
compiling xml_encoding_handler.c
compiling xml_entity_decl.c
compiling xml_entity_reference.c
In file included from /usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby.h:33,
from ./nokogiri.h:33,
from ./xml_entity_reference.h:4,
from xml_entity_reference.c:1:
xml_entity_reference.c: In function ‘new’:
/usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:2508:48: warning: cast discards ‘const’ qualifier from pointer target type [-Wcast-qual]
2508 | (rb_scan_args_verify(fmt, varc), vars), (char *)fmt, varc)
| ^
/usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:2340:9: note: in expansion of macro ‘rb_scan_args0’
2340 | rb_scan_args0(argc,argvp,fmt,\
| ^~~~~~~~~~~~~
xml_entity_reference.c:18:3: note: in expansion of macro ‘rb_scan_args’
18 | rb_scan_args(argc, argv, "2*", &document, &name, &rest);
| ^~~~~~~~~~~~
xml_entity_reference.c: At top level:
cc1: warning: unrecognized command line option ‘-Wno-self-assign’
cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
compiling xml_io.c
xml_io.c: In function ‘io_read_callback’:
xml_io.c:20:22: warning: passing argument 1 of ‘rb_rescue’ from incompatible pointer type [-Wincompatible-pointer-types]
20 | string = rb_rescue(read_check, (VALUE)args, read_failed, 0);
| ^~~~~~~~~~
| |
| VALUE (*)(VALUE *) {aka long unsigned int (*)(long unsigned int *)}
In file included from /usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby.h:33,
from ./nokogiri.h:33,
from ./xml_io.h:4,
from xml_io.c:1:
/usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:1987:17: note: expected ‘VALUE (*)(VALUE)’ {aka ‘long unsigned int (*)(long unsigned int)’} but argument is of type ‘VALUE (*)(VALUE *)’ {aka ‘long unsigned int (*)(long unsigned int *)’}
1987 | VALUE rb_rescue(VALUE(*)(VALUE),VALUE,VALUE(*)(VALUE,VALUE),VALUE);
| ^~~~~~~~~~~~~~~
xml_io.c:20:47: warning: passing argument 3 of ‘rb_rescue’ from incompatible pointer type [-Wincompatible-pointer-types]
20 | string = rb_rescue(read_check, (VALUE)args, read_failed, 0);
| ^~~~~~~~~~~
| |
| VALUE (*)(void) {aka long unsigned int (*)(void)}
In file included from /usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby.h:33,
from ./nokogiri.h:33,
from ./xml_node_set.h:4,
from xml_node_set.c:1:
xml_node_set.c: In function ‘slice’:
/usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:2508:48: warning: cast discards ‘const’ qualifier from pointer target type [-Wcast-qual]
2508 | (rb_scan_args_verify(fmt, varc), vars), (char *)fmt, varc)
| ^
/usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:2340:9: note: in expansion of macro ‘rb_scan_args0’
2340 | rb_scan_args0(argc,argvp,fmt,\
| ^~~~~~~~~~~~~
xml_node_set.c:294:5: note: in expansion of macro ‘rb_scan_args’
294 | rb_scan_args(argc, argv, "11", NULL, NULL);
| ^~~~~~~~~~~~
In file included from /usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby.h:33,
from ./nokogiri.h:33,
from ./xml_node_set.h:4,
from xml_node_set.c:1:
xml_node_set.c: In function ‘init_xml_node_set’:
/usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:2799:117: warning: passing argument 3 of ‘rb_define_method0’ from incompatible pointer type [-Wincompatible-pointer-types]
2799 | #define rb_define_method(klass, mid, func, arity) rb_define_method_choose_prototypem3((arity),(func))((klass),(mid),(func),(arity));
| ^~~~~~
| |
| VALUE (*)(VALUE, VALUE) {aka long unsigned int (*)(long unsigned int, long unsigned int)}
xml_node_set.c:479:3: note: in expansion of macro ‘rb_define_method’
479 | rb_define_method(klass, "to_a", to_array, 0);
| ^~~~~~~~~~~~~~~~
In file included from /usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:2148,
from /usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby.h:33,
from ./nokogiri.h:33,
from ./xml_node_set.h:4,
from xml_node_set.c:1:
/usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:2775:27: note: expected ‘VALUE (*)(VALUE)’ {aka ‘long unsigned int (*)(long unsigned int)’} but argument is of type ‘VALUE (*)(VALUE, VALUE)’ {aka ‘long unsigned int (*)(long unsigned int, long unsigned int)’}
2775 | RB_METHOD_DEFINITION_DECL(rb_define_method, (2,3), (VALUE klass, const char *name), (klass, name))
| ^~~~~~~~~~~~~~~~
/usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/intern.h:1042:82: note: in definition of macro ‘RB_METHOD_DEFINITION_DECL_C’
1042 | __attribute__((__unused__,__weakref__(#def),__nonnull__ nonnull))static void defname(RB_UNWRAP_MACRO decl,VALUE(*func)funcargs,int arity);
| ^~~~~~~
/usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/intern.h:1074:1: note: in expansion of macro ‘RB_METHOD_DEFINITION_DECL_1’
1074 | RB_METHOD_DEFINITION_DECL_1(def,nonnull,def##0 ,0 ,decl,vars,(VALUE)) \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:2775:1: note: in expansion of macro ‘RB_METHOD_DEFINITION_DECL’
2775 | RB_METHOD_DEFINITION_DECL(rb_define_method, (2,3), (VALUE klass, const char *name), (klass, name))
| ^~~~~~~~~~~~~~~~~~~~~~~~~
xml_node_set.c: At top level:
cc1: warning: unrecognized command line option ‘-Wno-self-assign’
cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
compiling xml_processing_instruction.c
In file included from /usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby.h:33,
from ./nokogiri.h:33,
from ./xml_processing_instruction.h:4,
from xml_processing_instruction.c:1:
xml_processing_instruction.c: In function ‘new’:
/usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:2508:48: warning: cast discards ‘const’ qualifier from pointer target type [-Wcast-qual]
2508 | (rb_scan_args_verify(fmt, varc), vars), (char *)fmt, varc)
| ^
/usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:2340:9: note: in expansion of macro ‘rb_scan_args0’
2340 | rb_scan_args0(argc,argvp,fmt,\
| ^~~~~~~~~~~~~
xml_processing_instruction.c:20:3: note: in expansion of macro ‘rb_scan_args’
20 | rb_scan_args(argc, argv, "3*", &document, &name, &content, &rest);
| ^~~~~~~~~~~~
xml_processing_instruction.c: At top level:
cc1: warning: unrecognized command line option ‘-Wno-self-assign’
cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
compiling xml_reader.c
In file included from /usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby.h:33,
from ./nokogiri.h:33,
from ./xml_reader.h:4,
from xml_reader.c:1:
xml_reader.c: In function ‘from_memory’:
/usr/share/rvm/rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:2508:48: warning: cast discards ‘const’ qualifier from pointer target type [-Wcast-qual]
2508 | (rb_scan_args_verify(fmt, varc), vars), (char *)fmt, varc)
| ^
| ^~~~~~~~~~~~
...
At top level:
xslt_stylesheet.c:112:13: warning: ‘swallow_superfluous_xml_errors’ defined but not used [-Wunused-function]
112 | static void swallow_superfluous_xml_errors(void * userdata, xmlErrorPtr error, ...)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: warning: unrecognized command line option ‘-Wno-self-assign’
cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
linking shared-object nokogiri/nokogiri.so
Cleaning files only used during build.
rm -rf /home/hizmarck/.rvm/gems/ruby-2.7.1/gems/nokogiri-1.10.9/ext/nokogiri/tmp/x86_64-pc-linux-gnu/ports
rm -rf /home/hizmarck/.rvm/gems/ruby-2.7.1/gems/nokogiri-1.10.9/ports
current directory: /home/hizmarck/.rvm/gems/ruby-2.7.1/gems/nokogiri-1.10.9/ext/nokogiri
make "DESTDIR=" install
make: /usr/bin/mkdir: Command not found
make: *** [Makefile:202: .sitearchdir.-.nokogiri.time] Error 127
make install failed, exit code 2
Gem files will remain installed in /home/hizmarck/.rvm/gems/ruby-2.7.1/gems/nokogiri-1.10.9 for inspection.
Results logged to /home/hizmarck/.rvm/gems/ruby-2.7.1/extensions/x86_64-linux/2.7.0/nokogiri-1.10.9/gem_make.out
I spend 2 days, I can't make it work.
rvm 1.29.10 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
yarn version 1.22.4
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]
This is the complete log:
https://drive.google.com/file/d/1tngDfaI9mXri16sTYcPflz8PLoieIQTT/view?usp=sharing
What could it be?
Thank you for your support.
Make process cannot find the mkdir command.
$ which mkdir
/bin/mkdir
Since the process is searching for the command in /usr/bin/mkdir it cannot be found. It is fixable by creating a symbolic link to the correct path:
sudo ln -s /bin/mkdir /usr/bin/mkdir
Answer source - stackoverflow post

Resources