Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing serialport Gem in Ruby 3.0.0 #69

Open
ninp0 opened this issue Jan 7, 2021 · 0 comments
Open

Installing serialport Gem in Ruby 3.0.0 #69

ninp0 opened this issue Jan 7, 2021 · 0 comments

Comments

@ninp0
Copy link

ninp0 commented Jan 7, 2021

Greetings,

In order to install the serialport gem using Ruby 3.0.0 on MacOS Big Sur (11.1) the following is required:

$ gem install serialport -- --with-cflags=-Wno-implicit-function-declaration

In order to install the serialport gem using Ruby 3.0.0 on MacOS Big Sur (11.1) the following is required when using bundler:

$ bundle config build.serialport --with-cflags=-Wno-implicit-function-declaration
$ bundle install

Is there a fix to address the issue? Simply executing:

$ gem install serialport

generates the following error:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /usr/local/rvm/gems/ruby-3.0.0@global/gems/serialport-1.3.1/ext/native
/usr/local/rvm/rubies/ruby-3.0.0/bin/ruby -I /usr/local/rvm/rubies/ruby-3.0.0/lib/ruby/site_ruby/3.0.0 -r
./siteconf20210107-73355-9t3pde.rb extconf.rb
checking for OS... darwin
checking for termios.h... yes
checking for unistd.h... yes
creating Makefile

current directory: /usr/local/rvm/gems/ruby-3.0.0@global/gems/serialport-1.3.1/ext/native
make DESTDIR\= clean

current directory: /usr/local/rvm/gems/ruby-3.0.0@global/gems/serialport-1.3.1/ext/native
make DESTDIR\=
compiling posix_serialport_impl.c
posix_serialport_impl.c:113:4: error: implicit declaration of function 'rb_secure' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
   rb_secure(4);
   ^
posix_serialport_impl.c:114:13: warning: incompatible pointer to integer conversion passing 'struct RFile *' to
parameter of type 'VALUE' (aka 'unsigned long') [-Wint-conversion]
   OBJSETUP(sp, class, T_FILE);
            ^~
/usr/local/rvm/rubies/ruby-3.0.0/include/ruby-3.0.0/ruby/internal/newobj.h:43:26: note: passing argument to parameter
'obj' here
VALUE rb_obj_setup(VALUE obj, VALUE klass, VALUE type);
                         ^
1 warning and 1 error generated.
make: *** [posix_serialport_impl.o] Error 1

make failed, exit code 2

Gem files will remain installed in /usr/local/rvm/gems/ruby-3.0.0@global/gems/serialport-1.3.1 for inspection.
Results logged to /usr/local/rvm/gems/ruby-3.0.0@global/extensions/x86_64-darwin-20/3.0.0/serialport-1.3.1/gem_make.out

Please provide guidance around addressing this at your earliest convenience. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant