error occurred while installing semacode (0.7.5) gem - ruby-on-rails

Issue while installing semacode gem from gemfile. is there a way to resolve this? i am running bundle install. Is this a issue with my machine or a gem issue? This issue did happen for the first time on my machine when i tried to run the application locally.
Using semacode 0.7.5 from https://github.com/toretore/semacode.git (at master#4e31e0b)
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
make "DESTDIR=" clean
.rbenv/versions/2.3.5/lib/ruby/gems/2.3.0/bundler/gems/semacode-4e31e0b79a1a/ext
make "DESTDIR="
compiling reedsol.c
compiling semacode.c
semacode.c:61:3: error: implicit declaration of function 'iec16022init' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
iec16022init(&semacode->width, &semacode->height, message);
^
semacode.c:96:28: warning: 'bzero' call operates on objects of type 'semacode_t' (aka 'struct semacode_t') while the size is based on a different type 'semacode_t *' (aka 'struct
semacode_t *') [-Wsizeof-pointer-memaccess]
bzero(semacode, sizeof(semacode));
~~~~~~~~ ^~~~~~~~
semacode.c:96:28: note: did you mean to dereference the argument to 'sizeof' (and multiply it by the number of elements)?
bzero(semacode, sizeof(semacode));
^~~~~~~~
semacode.c:129:27: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
encode_string(semacode, StringValueLen(message), StringValuePtr(message));
~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~
./semacode.h:26:27: note: expanded from macro 'StringValueLen'
#define StringValueLen(s) RSTRING_LEN(RB_STRING_VALUE(s))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RSTRING_EMBED_LEN(str) : \
^~~~~~~~~~~~~~~~~~~~~~
(long)((RBASIC(str)->flags >> RSTRING_EMBED_LEN_SHIFT) & \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
semacode.c:129:27: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
encode_string(semacode, StringValueLen(message), StringValuePtr(message));
~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~
./semacode.h:26:27: note: expanded from macro 'StringValueLen'
#define StringValueLen(s) RSTRING_LEN(RB_STRING_VALUE(s))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-2.3.0/ruby/ruby.h:995:28: note: expanded from macro 'RSTRING_LEN'
RSTRING(str)->as.heap.len)
~~~~~~~~~~~~~~~~~~~~~~^~~
semacode.c:239:20: warning: equality comparison result unused [-Wunused-comparison]
semacode->data == NULL;
~~~~~~~~~~~~~~~^~~~~~~
semacode.c:239:20: note: use '=' to turn this equality comparison into an assignment
semacode->data == NULL;
^~
=
semacode.c:243:44: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
DATA_PTR(self) = encode_string(semacode, StringValueLen(message), StringValuePtr(message));
~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~
./semacode.h:26:27: note: expanded from macro 'StringValueLen'
#define StringValueLen(s) RSTRING_LEN(RB_STRING_VALUE(s))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.rbenv/versions/2.3.5/include/ruby-2.3.0/ruby/ruby.h:994:6: note: expanded from macro 'RSTRING_LEN'
RSTRING_EMBED_LEN(str) : \
^~~~~~~~~~~~~~~~~~~~~~
.rbenv/versions/2.3.5/include/ruby-2.3.0/ruby/ruby.h:990:6: note: expanded from macro 'RSTRING_EMBED_LEN'
(long)((RBASIC(str)->flags >> RSTRING_EMBED_LEN_SHIFT) & \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
semacode.c:243:44: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
DATA_PTR(self) = encode_string(semacode, StringValueLen(message), StringValuePtr(message));
~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~
./semacode.h:26:27: note: expanded from macro 'StringValueLen'
#define StringValueLen(s) RSTRING_LEN(RB_STRING_VALUE(s))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.rbenv/versions/2.3.5/include/ruby-2.3.0/ruby/ruby.h:995:28: note: expanded from macro 'RSTRING_LEN'
RSTRING(str)->as.heap.len)
~~~~~~~~~~~~~~~~~~~~~~^~~
6 warnings and 1 error generated.
make: *** [semacode.o] Error 1
make failed, exit code 2
Gem files will remain installed in .rbenv/versions/2.3.5/lib/ruby/gems/2.3.0/bundler/gems/semacode-4e31e0b79a1a for inspection.
Results logged to .rbenv/versions/2.3.5/lib/ruby/gems/2.3.0/bundler/gems/extensions/x86_64-darwin-19/2.3.0-static/semacode-4e31e0b79a1a/gem_make.out
An error occurred while installing semacode (0.7.5), and Bundler cannot continue.
In Gemfile:
semacode

Try this
gem install semacode -v 0.7.5 -- --with-cflags="-Wno-error=implicit-function-declaration"
Here is more information:
Clang now reports an error when you use a function without an explicit declaration when building C or Objective-C code for macOS (-Werror=implicit-function-declaration flag is on). This additional error detection unifies Clang’s behavior for iOS/tvOS and macOS 64-bit targets for this diagnostic. (49917738)
https://developer.apple.com/documentation/xcode-release-notes/xcode-12-release-notes

I've seen some similar issues on macOS that have only started since v12 was released. If you have v12 you can try downgrading to v11.5 from download.developer.apple.com/Developer_Tools/… and retrying the gem installation
credits - #anothermh

Related

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

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

qemu-irix fails to build under Alpine 3.10 (GCC 8.3)

Just for fun, I'm attempting to build the irixxxx's qemu-irix as a Docker image.
It builds successfuly under Debian Buster (using GCC 8 container). However, it fails to build under Alpine 3.10 (it fails only when I selected the Irix targets), with the following errors (at the make stage):
CC util/oslib-posix.o
In file included from util/oslib-posix.c:39:
/usr/include/sys/signal.h:1:2: warning: #warning redirecting incorrect #include <sys/signal.h> to <signal.h> [-Wcpp]
#warning redirecting incorrect #include <sys/signal.h> to <signal.h>
^~~~~~~
CC util/qemu-openpty.o
util/qemu-openpty.c: In function 'qemu_openpty_raw':
util/qemu-openpty.c:123:9: warning: implicit declaration of function 'openpty'; did you mean 'openat'? [-Wimplicit-function-declaration]
if (openpty(&amaster, aslave, pty_buf, NULL, NULL) < 0) {
^~~~~~~
openat
util/qemu-openpty.c:123:9: warning: nested extern declaration of 'openpty' [-Wnested-externs]
(...)
CC irix-linux-user/linux-user/syscall.o
/qemu-irix/linux-user/syscall.c:6784:22: error: 'F_EXLCK' undeclared here (not in a function); did you mean 'F_RDLCK'?
TRANSTBL_CONVERT(F_EXLCK),
^~~~~~~
/qemu-irix/linux-user/syscall.c:6779:51: note: in definition of macro 'TRANSTBL_CONVERT'
#define TRANSTBL_CONVERT(a) { -1, TARGET_##a, -1, a }
^
/qemu-irix/linux-user/syscall.c:6785:22: error: 'F_SHLCK' undeclared here (not in a function); did you mean 'F_RDLCK'?
TRANSTBL_CONVERT(F_SHLCK),
^~~~~~~
/qemu-irix/linux-user/syscall.c:6779:51: note: in definition of macro 'TRANSTBL_CONVERT'
#define TRANSTBL_CONVERT(a) { -1, TARGET_##a, -1, a }
^
In file included from /qemu-irix/linux-user/syscall.c:121:
/qemu-irix/linux-user/syscall.c: In function 'target_to_host_sigevent':
/qemu-irix/linux-user/syscall.c:7422:27: error: 'struct sigevent' has no member named '_sigev_un'; did you mean 'sigev_value'?
__get_user(host_sevp->_sigev_un._tid, &target_sevp->_sigev_un._tid);
^~~~~~~~~
/qemu-irix/linux-user/qemu.h:501:5: note: in definition of macro '__get_user_e'
((x) = (typeof(*hptr))( \
^
/qemu-irix/linux-user/syscall.c:7422:5: note: in expansion of macro '__get_user'
__get_user(host_sevp->_sigev_un._tid, &target_sevp->_sigev_un._tid);
^~~~~~~~~~
/qemu-irix/linux-user/syscall.c:7422:36: error: '(const bitmask_transtbl *)&<erroneous-expression>' is a pointer; did you mean to use '->'?
__get_user(host_sevp->_sigev_un._tid, &target_sevp->_sigev_un._tid);
^
/qemu-irix/linux-user/qemu.h:501:5: note: in definition of macro '__get_user_e'
((x) = (typeof(*hptr))( \
^
/qemu-irix/linux-user/syscall.c:7422:5: note: in expansion of macro '__get_user'
__get_user(host_sevp->_sigev_un._tid, &target_sevp->_sigev_un._tid);
^~~~~~~~~~
/qemu-irix/linux-user/qemu.h:506:13: warning: left-hand operand of comma expression has no effect [-Wunused-value]
(hptr)), (void)0)
^
/qemu-irix/linux-user/qemu.h:510:31: note: in expansion of macro '__get_user_e'
# define __get_user(x, hptr) __get_user_e(x, hptr, be)
^~~~~~~~~~~~
/qemu-irix/linux-user/syscall.c:7422:5: note: in expansion of macro '__get_user'
__get_user(host_sevp->_sigev_un._tid, &target_sevp->_sigev_un._tid);
^~~~~~~~~~
/qemu-irix/linux-user/syscall.c: In function 'do_syscall':
/qemu-irix/linux-user/syscall.c:13545:25: warning: implicit declaration of function 'sethostid'; did you mean 'gethostid'? [-Wimplicit-function-declaration]
ret = get_errno(sethostid(arg1));
^~~~~~~~~
gethostid
/qemu-irix/linux-user/syscall.c:13545:25: warning: nested extern declaration of 'sethostid' [-Wnested-externs]
make[1]: *** [/qemu-irix/rules.mak:66: linux-user/syscall.o] Error 1
make: *** [Makefile:472: subdir-irix-linux-user] Error 2
The command '/bin/sh -c make && DESTDIR=/tmp/qemu make install' returned a non-zero code: 2
I researched about the differences between Debian's and Alpine's GCC (in fact, libc6 and musl) about similar failures, but I haven't found any information about how to solve this without modifying the code.
So, where can I find more information about this issue and which packages may solve it? Thanks.
Dockerfiles and full log here. Docker container image (Debian Buster) here.
The difference seems to be caused by the underlying libc implementations: glibc of Debian, vs musl-libc of Alpine.
While GNU libc is the defacto standard libc implementation in Linux, musl libc is used by a handful of distributions, such as Alpine Linux and Void Linux. musl is a minimalistic strict-POSIX libc implementation, and is generally not compatible with glibc. Usually, software projects have to be ported to musl libc to be supported on Alpine, especially non trivial applications.
The compilation of syscall.c breaks on several places, the first being:
/qemu-irix/linux-user/syscall.c:6784:22: error: 'F_EXLCK' undeclared here (not in a function); did you mean 'F_RDLCK'?
TRANSTBL_CONVERT(F_EXLCK)
The F_EXLCK is macro is not defined in musl libc's fcntl.h. However, it could be easily patched by defining it manually, for example with make CFLAGS='"-DF_EXLCK=4"'. This is how qemu is patched for musl for non-irix targets (patch link).
However, there are more undefined macros down the road, such as __SIGRTMIN and __SIGRTMAX, the macro TRANSTBL_CONVERT, and probably others. Patching them ad-hoc may not be enough - so it appears to be that the qemu-irix project has to be properly ported for Alpine and musl libc.
If you're willing, you could try following existing qemu musl patches, and attempt to patch it yourself for qemu-irix:
- https://lists.gnu.org/archive/html/qemu-devel/2014-04/msg04773.html
- https://github.com/NixOS/nixpkgs/pull/46449/files
Off topic comment, use make -j to build parallely, which will end much faster.

ERROR: Error installing oj:

I just cloned a repository from GitHub for the first time.
I went to check it out on my local machine, so within the local repository on my mac I ran the following command
bin/rails server
I got the following error:
Could not find activesupport-5.0.0.1 in any of the sources
Run bundle install to install missing gems.
So I then ran the bundle install command as suggested, but then it gave me the following error
An error occurred while installing oj (2.12.14), and Bundler cannot continue.
Make sure that gem install oj -v '2.12.14' succeeds before bundling.
So as suggested I ran: gem install oj -v '2.12.14'
Then I got a really long message with warning and an error (see below). Any thoughts?
ERROR: Error installing oj:
ERROR: Failed to build gem native extension.
current directory: /usr/local/lib/ruby/gems/2.4.0/gems/oj-2.12.14/ext/oj
/usr/local/opt/ruby/bin/ruby -r ./siteconf20170218-3717-1p2bvl9.rb extconf.rb
>>>>> Creating Makefile for ruby version 2.4.0 on x86_64-darwin16 <<<<<
creating Makefile
current directory: /usr/local/lib/ruby/gems/2.4.0/gems/oj-2.12.14/ext/oj
make "DESTDIR=" clean
current directory: /usr/local/lib/ruby/gems/2.4.0/gems/oj-2.12.14/ext/oj
make "DESTDIR="
compiling cache8.c
compiling circarray.c
compiling compat.c
compiling dump.c
dump.c:503:8: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
cnt = RSTRING_LEN(rstr);
~ ^~~~~~~~~~~~~~~~~
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:976:6: note: expanded from macro 'RSTRING_LEN'
RSTRING_EMBED_LEN(str) : \
^~~~~~~~~~~~~~~~~~~~~~
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:972:6: note: expanded from macro 'RSTRING_EMBED_LEN'
(long)((RBASIC(str)->flags >> RSTRING_EMBED_LEN_SHIFT) & \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dump.c:503:8: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
cnt = RSTRING_LEN(rstr);
~ ^~~~~~~~~~~~~~~~~
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:977:28: note: expanded from macro 'RSTRING_LEN'
RSTRING(str)->as.heap.len)
~~~~~~~~~~~~~~~~~~~~~~^~~
dump.c:1776:39: warning: 'rb_struct_ptr' is deprecated [-Wdeprecated-declarations]
for (i = (int)RSTRUCT_LEN(obj), vp = RSTRUCT_PTR(obj); 0 < i; i--, vp++) {
^
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:1190:33: note: expanded from macro 'RSTRUCT_PTR'
#define RSTRUCT_PTR(st) rb_struct_ptr(st)
^
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/intern.h:889:25: note: 'rb_struct_ptr' has been explicitly marked deprecated here
DEPRECATED(const VALUE *rb_struct_ptr(VALUE s));
^
dump.c:1776:37: warning: assigning to 'VALUE *' (aka 'unsigned long *') from 'const VALUE *' (aka 'const unsigned long *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
for (i = (int)RSTRUCT_LEN(obj), vp = RSTRUCT_PTR(obj); 0 < i; i--, vp++) {
^ ~~~~~~~~~~~~~~~~
4 warnings generated.
compiling err.c
compiling fast.c
fast.c:816:17: warning: 'rb_data_object_alloc' is deprecated: by rb_data_object_wrap [-Wdeprecated-declarations]
doc->self = rb_data_object_alloc(clas, doc, 0, free_doc_cb);
^
/usr/local/Cellar/ruby/2.4.0/include/ruby-2.4.0/ruby/ruby.h:1379:1: note: 'rb_data_object_alloc' has been explicitly marked deprecated here
rb_data_object_alloc(VALUE klass, void *data, RUBY_DATA_FUNC dmark, RUBY_DATA_FUNC dfree)
^
fast.c:1280:24: error: use of undeclared identifier 'rb_cFixnum'
case T_FIXNUM: type = rb_cFixnum; break;
^
1 warning and 1 error generated.
make: *** [fast.o] Error 1
make failed, exit code 2
Gem files will remain installed in /usr/local/lib/ruby/gems/2.4.0/gems/oj-2.12.14 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.4.0/extensions/x86_64-darwin-16/2.4.0/oj-2.12.14/gem_make.out
Fixnum is no longer a thing in ruby 2.4. Either downgrade your ruby or update oj to 2.16.1, which supports ruby 2.4.

Resources