0

A rails application created with Ruby 3.1.0 and rails 7.0.3 on a Mac OS X 10.13.6 bundles all required gems using Bundler version 2.3.3

When migrating the application to Mac OS X 12.3 (monterey) with the same bundler version, this is encountered:

An error occurred while installing semacode-ruby19 (0.7.4), and Bundler cannot continue.

Commenting out the gem allows the gem intallation procedure to complete. However the application remains incomplete, test/test_helper.rb for example needs to be commented out as the application tests the generation of Barby::DataMatrix.new(...)

The aforementioned gem has not been updated in a long time (thus no expectations should be entertained) - however the functionality of encoding DataMatrix for ruby remains a going concern. What options are open at this point?

I remain uncertain as to the source of the problem - the ∆s are OS X and homebrew - and thus uncertain as to where to report this. Suggestions welcome.

Update

As per the suggestion, the manual installation of the gem also fails:

gem install semacode -v 0.7.4 -- --with-cflags="-Wno-error=implicit-function-declaration"

Fetching semacode-0.7.4.gem
Building native extensions with: '--with-cflags=-Wno-error=implicit-function-declaration'
This could take a while...
ERROR:  Error installing semacode:
    ERROR: Failed to build gem native extension.

    current directory: /Users/deploy/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/semacode-0.7.4/ext
/Users/deploy/.rbenv/versions/3.1.0/bin/ruby -I /Users/deploy/.rbenv/versions/3.1.0/lib/ruby/3.1.0 -r ./siteconf20220830-40292-dndt8s.rb extconf.rb --with-cflags\=-Wno-error\=implicit-function-declaration
creating Makefile

current directory: /Users/deploy/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/semacode-0.7.4/ext
make DESTDIR\= clean

current directory: /Users/deploy/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/semacode-0.7.4/ext
make DESTDIR\=
compiling iec16022ecc200.c
iec16022ecc200.c:284:80: warning: data argument not used by format string [-Wformat-extra-args]
                     rb_raise(rb_eArgError,  "cannot encode character in X12", c);
                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
iec16022ecc200.c:299:80: warning: data argument not used by format string [-Wformat-extra-args]
                     rb_raise(rb_eArgError,  "cannot encode character in X12", c);
                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
iec16022ecc200.c:323:89: warning: data argument not used by format string [-Wformat-extra-args]
                           rb_raise(rb_eRuntimeError,  "this should not be happening!", c);
                                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
iec16022ecc200.c:498:9: warning: incompatible pointer to integer conversion initializing 'VALUE' (aka 'unsigned long') with an expression of type 'void *' [-Wint-conversion]
  VALUE rb_str = NULL;
        ^        ~~~~
iec16022ecc200.c:908:12: warning: assigning to 'unsigned char *' from 'char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
      grid = ALLOC_N(char, W * H);
           ^ ~~~~~~~~~~~~~~~~~~~~
5 warnings generated.
compiling reedsol.c
compiling semacode.c
semacode.c:61:3: warning: implicit declaration of function 'iec16022init' is invalid in C99 [-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: error: no member named 'len' in 'struct RString'
  encode_string(semacode, StringValueLen(message), StringValuePtr(message));
                          ^~~~~~~~~~~~~~~~~~~~~~~
./semacode.h:26:56: note: expanded from macro 'StringValueLen'
#define StringValueLen(s) RSTRING(RB_STRING_VALUE(s))->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: error: no member named 'len' in 'struct RString'
  DATA_PTR(self) = encode_string(semacode, StringValueLen(message), StringValuePtr(message));
                                           ^~~~~~~~~~~~~~~~~~~~~~~
./semacode.h:26:56: note: expanded from macro 'StringValueLen'
#define StringValueLen(s) RSTRING(RB_STRING_VALUE(s))->len
                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
3 warnings and 2 errors generated.
make: *** [semacode.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/deploy/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/semacode-0.7.4 for inspection.
Results logged to /Users/deploy/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/extensions/arm64-darwin-21/3.1.0/semacode-0.7.4/gem_make.out
Jerome
  • 5,583
  • 3
  • 33
  • 76

0 Answers0