mapstatic icon indicating copy to clipboard operation
mapstatic copied to clipboard

gem install fails - maybe undocumented requirement

Open php4fan opened this issue 4 months ago • 1 comments

On Debian 12 I tried to install with:

apt install ruby ruby-dev
gem install mapstatic

and I got this error:

ERROR:  Error installing mapstatic:
        ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/3.1.0/gems/ffi-1.17.2/ext/ffi_c
/usr/bin/ruby3.1 -I /usr/lib/ruby/vendor_ruby -r ./siteconf20250715-81631-kznjtq.rb extconf.rb
checking for ffi.h... *** 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/bin/$(RUBY_BASE_NAME)3.1
        --with-ffi_c-dir
        --without-ffi_c-dir
        --with-ffi_c-include
        --without-ffi_c-include=${ffi_c-dir}/include
        --with-ffi_c-lib
        --without-ffi_c-lib=${ffi_c-dir}/lib
        --enable-debug
        --disable-debug
        --enable-system-libffi
        --disable-system-libffi
        --with-libffi-dir
        --without-libffi-dir
        --with-libffi-include
        --without-libffi-include=${libffi-dir}/include
        --with-libffi-lib
        --without-libffi-lib=${libffi-dir}/lib
        --with-libffi-config
        --without-libffi-config
        --with-pkg-config
        --without-pkg-config
        --with-ffi-dir
        --without-ffi-dir
        --with-ffi-include
        --without-ffi-include=${ffi-dir}/include
        --with-ffi-lib
        --without-ffi-lib=${ffi-dir}/lib
/usr/lib/ruby/3.1.0/mkmf.rb:498:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
        from /usr/lib/ruby/3.1.0/mkmf.rb:624:in `block in try_compile'
        from /usr/lib/ruby/3.1.0/mkmf.rb:573:in `with_werror'
        from /usr/lib/ruby/3.1.0/mkmf.rb:624:in `try_compile'
        from /usr/lib/ruby/3.1.0/mkmf.rb:1160:in `block in have_header'
        from /usr/lib/ruby/3.1.0/mkmf.rb:1007:in `block in checking_for'
        from /usr/lib/ruby/3.1.0/mkmf.rb:362:in `block (2 levels) in postpone'
        from /usr/lib/ruby/3.1.0/mkmf.rb:332:in `open'
        from /usr/lib/ruby/3.1.0/mkmf.rb:362:in `block in postpone'
        from /usr/lib/ruby/3.1.0/mkmf.rb:332:in `open'
        from /usr/lib/ruby/3.1.0/mkmf.rb:358:in `postpone'
        from /usr/lib/ruby/3.1.0/mkmf.rb:1006:in `checking_for'
        from /usr/lib/ruby/3.1.0/mkmf.rb:1159:in `have_header'
        from extconf.rb:10:in `system_libffi_usable?'
        from extconf.rb:46:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /var/lib/gems/3.1.0/extensions/x86_64-linux/3.1.0/ffi-1.17.2/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/3.1.0/gems/ffi-1.17.2 for inspection.
Results logged to /var/lib/gems/3.1.0/extensions/x86_64-linux/3.1.0/ffi-1.17.2/gem_make.out

The contents of /var/lib/gems/3.1.0/extensions/x86_64-linux/3.1.0/ffi-1.17.2/mkmf.log are:

package configuration for libffi is not found
LD_LIBRARY_PATH=.:/usr/lib/x86_64-linux-gnu "x86_64-linux-gnu-gcc -o conftest -I/usr/include/x86_64-linux-gnu/ruby-3.1.0 -I/usr/include/ruby-3.1.0/ruby/backward -I/usr/include/ruby-3.1.0 -I. -Wdate-time -D_FORTIFY_SOURCE=2   -g -O2 -ffile-prefix-map=BUILDDIR=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC conftest.c  -L. -L/usr/lib/x86_64-linux-gnu -L. -Wl,-z,relro -Wl,-z,now -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,--no-as-needed     -lruby-3.1  -lm  -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5:   return !!argv[argc];
6: }
/* end */

Maybe I'm just missing some dependency that is not listed under "Requirements".

php4fan avatar Jul 15 '25 08:07 php4fan

I have libffi8 (apt package) installed, and installing libffi-dev made no difference.

php4fan avatar Jul 15 '25 08:07 php4fan