mysql2 Ruby Gem failed to install ubuntu 20.04 - ruby-on-rails

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

Related

Can't build charlock_holmes native gem

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

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

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 :)

Ruby gem 'byebug 5.0.0' failing on install due to make error

I'm attempting to install the byebug gem v5.0.0 in a ubuntu environment.
The v 5.0.0 is a project requirement, I can not use a newer version.
These are the current versions that I am using
bundle -v
Bundler version 2.1.4
ruby -v
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]
bundle -v
Bundler version 2.1.4
rvm -v
rvm 1.29.10 (manual) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
rails -v
Rails 5.2.3
When I attempt to install with gem install byebug -v 5.0.0 the following is written to cli.
The install appears to be failing when executing the make file for the gem
Even if i attempt to execute make in the /var/lib/gems/2.7.0/gems/byebug-5.0.0/ext/byebug directory, I get the same error message starting with the context.c file.
This seems to be some install issue with the 5.0.0 version, I did attempt to install the newest version of byebug for testing, and it installed successfully.
current directory: /var/lib/gems/2.7.0/gems/byebug-5.0.0/ext/byebug
/usr/bin/ruby2.7 -I /usr/lib/ruby/2.7.0 -r ./siteconf20201011-7796-1qpm603.rb extconf.rb
creating Makefile
current directory: /var/lib/gems/2.7.0/gems/byebug-5.0.0/ext/byebug
make "DESTDIR=" clean
current directory: /var/lib/gems/2.7.0/gems/byebug-5.0.0/ext/byebug
make "DESTDIR="
compiling breakpoint.c
compiling byebug.c
compiling context.c
context.c: In function ‘call_with_debug_inspector’:
context.c:191:20: error: passing argument 1 of ‘rb_ensure’ from incompatible pointer type [-Werror=incompatible-pointer-types]
191 | return rb_ensure(open_debug_inspector, (VALUE) data, close_debug_inspector,
| ^~~~~~~~~~~~~~~~~~~~
| |
| VALUE (*)(struct call_with_inspection_data *) {aka long unsigned int (*)(struct call_with_inspection_data *)}
In file included from /usr/include/ruby-2.7.0/ruby.h:33,
from ./byebug.h:4,
from context.c:1:
/usr/include/ruby-2.7.0/ruby/ruby.h:1990:17: note: expected ‘VALUE (*)(VALUE)’ {aka ‘long unsigned int (*)(long unsigned int)’} but argument is of type ‘VALUE (*)(struct call_with_inspection_data *)’ {aka ‘long unsigned int (*)(struct call_with_inspection_data *)’}
1990 | VALUE rb_ensure(VALUE(*)(VALUE),VALUE,VALUE(*)(VALUE),VALUE);
| ^~~~~~~~~~~~~~~
context.c:191:56: error: passing argument 3 of ‘rb_ensure’ from incompatible pointer type [-Werror=incompatible-pointer-types]
191 | return rb_ensure(open_debug_inspector, (VALUE) data, close_debug_inspector,
| ^~~~~~~~~~~~~~~~~~~~~
| |
| VALUE (*)(struct call_with_inspection_data *) {aka long unsigned int (*)(struct call_with_inspection_data *)}
In file included from /usr/include/ruby-2.7.0/ruby.h:33,
from ./byebug.h:4,
from context.c:1:
/usr/include/ruby-2.7.0/ruby/ruby.h:1990:39: note: expected ‘VALUE (*)(VALUE)’ {aka ‘long unsigned int (*)(long unsigned int)’} but argument is of type ‘VALUE (*)(struct call_with_inspection_data *)’ {aka ‘long unsigned int (*)(struct call_with_inspection_data *)’}
1990 | VALUE rb_ensure(VALUE(*)(VALUE),VALUE,VALUE(*)(VALUE),VALUE);
| ^~~~~~~~~~~~~~~
In file included from /usr/include/ruby-2.7.0/ruby/ruby.h:2148,
from /usr/include/ruby-2.7.0/ruby.h:33,
from ./byebug.h:4,
from context.c:1:
context.c: In function ‘Init_context’:
/usr/include/ruby-2.7.0/ruby/intern.h:1218:137: error: passing argument 3 of ‘rb_define_singleton_method1’ from incompatible pointer type [-Werror=incompatible-pointer-types]
1218 | #define rb_define_singleton_method(klass, mid, func, arity) rb_define_singleton_method_choose_prototypem3((arity),(func))((klass),(mid),(func),(arity));
| ^~~~~~
| |
| VALUE (*)(VALUE) {aka long unsigned int (*)(long unsigned int)}
context.c:673:3: note: in expansion of macro ‘rb_define_singleton_method’
673 | rb_define_singleton_method(cDebugThread, "inherited", dt_inherited, 1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ruby-2.7.0/ruby/intern.h:1195:27: note: expected ‘VALUE (*)(VALUE, VALUE)’ {aka ‘long unsigned int (*)(long unsigned int, long unsigned int)’} but argument is of type ‘VALUE (*)(VALUE)’ {aka ‘long unsigned int (*)(long unsigned int)’}
1195 | RB_METHOD_DEFINITION_DECL(rb_define_singleton_method, (2,3), (VALUE klass, const char *name), (klass, name))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/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/include/ruby-2.7.0/ruby/intern.h:1075:1: note: in expansion of macro ‘RB_METHOD_DEFINITION_DECL_1’
1075 | RB_METHOD_DEFINITION_DECL_1(def,nonnull,def##1 ,1 ,decl,vars,(VALUE,VALUE)) \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ruby-2.7.0/ruby/intern.h:1195:1: note: in expansion of macro ‘RB_METHOD_DEFINITION_DECL’
1195 | RB_METHOD_DEFINITION_DECL(rb_define_singleton_method, (2,3), (VALUE klass, const char *name), (klass, name))
| ^~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:245: context.o] Error 1
make failed, exit code 2
That version of byebug is from 2015 when ruby was on v2.2.1
If you can’t use a newer bye bug; use the older ruby.
That older version of ruby is probably going to require you to use older versions of all the gems your project needs. Do you have a Gemfile.lock showing the target versions? If not you might have to use ruby gems to find what version each gen was the latest in early 2015.
https://rubygems.org/gems/byebug/versions Shows the version released dates for byebug.

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