iron-io / dockers

Uber tiny Docker images for all the things.
http://www.iron.io
MIT License
1.59k stars 139 forks source link

iron/ruby dev: native gem build fails with "asm/types.h: No such file" #49

Closed thom-nic closed 6 years ago

thom-nic commented 8 years ago

This gem is a transitive dependency and appears to depend on some kernel modules according to the readme The actual error is

linux_inet_diag.c:53:23: fatal error: asm/types.h: No such file or directory

bundle install build output:

Installing raindrops 0.15.0 with native extensions

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

    /usr/bin/ruby -r ./siteconf20160418-7-a17kji.rb extconf.rb --use-system-libraries
checking for mmap() in sys/mman.h... yes
checking for munmap() in sys/mman.h... yes
checking for mremap() in sys/mman.h... yes
checking for linux/tcp.h... no
checking for getpagesize() in unistd.h... yes
checking for rb_thread_blocking_region()... no
checking for rb_thread_io_blocking_region()... yes
checking for GCC 4+ atomic builtins... yes
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling linux_inet_diag.c
linux_inet_diag.c:53:23: fatal error: asm/types.h: No such file or directory
compilation terminated.
Makefile:237: recipe for target 'linux_inet_diag.o' failed
make: *** [linux_inet_diag.o] Error 1

make failed, exit code 2

If I try to modprobe inet_diag I get

modprobe: can't change directory to '/lib/modules': No such file or directory
flah00 commented 8 years ago

I managed to fix this by installing linux-headers, which provides the missing header file. https://pkgs.alpinelinux.org/contents?repo=main&page=2&arch=x86&branch=edge&name=linux-headers

FrankFang commented 5 years ago

@flah00 Could you show me your command for fixing it.

c0ze commented 5 years ago

@FrankFang maybe apk add linux-headers ?