Hi, I am trying to install the nokogiri Ruby gem using "gem install nokogiri" and have the ruby-2.5.5 package from ports for that purpose installed.
Unfortunately it does not want to install complaining that the 'machine/cdefs.h' header file can not be found. This header file is included on line 41 of /usr/include/sys/cdefs.h but is not present on my OpenBSD 6.5 system. Am I missing something here? I have pasted below the full error output from installing that gem if that is of any help. Best regards, Mabi $ gem install nokogiri Building native extensions. This could take a while... ERROR: Error installing nokogiri: ERROR: Failed to build gem native extension. current directory: /home/ma/.gem/gems/nokogiri-1.10.5/ext/nokogiri /usr/local/bin/ruby25 -r ./siteconf20191116-77258-1qm6dzx.rb extconf.rb checking if the C compiler accepts -I /usr/local/include... *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/usr/local/bin/$(RUBY_BASE_NAME)25 --help --clean --use-system-libraries /usr/local/lib/ruby/2.5/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from /usr/local/lib/ruby/2.5/mkmf.rb:574:in `block in try_compile' from /usr/local/lib/ruby/2.5/mkmf.rb:521:in `with_werror' from /usr/local/lib/ruby/2.5/mkmf.rb:574:in `try_compile' from extconf.rb:138:in `nokogiri_try_compile' from extconf.rb:162:in `block in add_cflags' from /usr/local/lib/ruby/2.5/mkmf.rb:632:in `with_cflags' from extconf.rb:161:in `add_cflags' from extconf.rb:416:in `<main>' To see why this extension failed to compile, please check the mkmf.log which can be found here: /home/ma/.gem/extensions/x86_64-openbsd/2.5/nokogiri-1.10.5/mkmf.log extconf failed, exit code 1 Gem files will remain installed in /home/ma/.gem/gems/nokogiri-1.10.5 for inspection. Results logged to /home/ma/.gem/extensions/x86_64-openbsd/2.5/nokogiri-1.10.5/gem_make.out *** Content of the nokogiri-1.10.5/mkmf.log file below: *** "cc -o conftest -I/usr/local/include/ruby-2.5/x86_64-openbsd -I/usr/local/include/ruby-2.5/ruby/backward -I/usr/local/include/ruby-2.5 -I. -DOPENSSL_NO_STATIC_ENGINE -I/usr/local/include -O2 -pipe -fPIC -I /usr/local/include conftest.c -L. -L/usr/local/lib -Wl,-rpath,/usr/local/lib -L. -L/usr/local/lib -fstack-protector -Wl,-E -Wl,-rpath,/usr/local/lib -L/usr/local/lib -lruby25 -pthread -lgmp -lm -lc " In file included from conftest.c:1: In file included from /usr/local/include/ruby-2.5/ruby.h:33: In file included from /usr/local/include/ruby-2.5/ruby/ruby.h:29: In file included from /usr/local/include/ruby-2.5/ruby/defines.h:112: In file included from /usr/include/stdio.h:41: /usr/include/sys/cdefs.h:41:10: fatal error: 'machine/cdefs.h' file not found #include <machine/cdefs.h> ^~~~~~~~~~~~~~~~~ 1 error generated. checked program was: /* begin */ 1: #include "ruby.h" 2: 3: int main(int argc, char **argv) 4: { 5: return 0; 6: } /* end */