Site icon Nuventure Blog

Jekyll Docker image missing C headers

So, if you are using Jekyll Docker image and you need to install any Ruby gems that require C headers, such as raindrops in my case, which was a dependency for unicorn, you will find yourself faced with this error:

fatal error: asm/types.h: No such file or directory

Fortunately, there is a quick fix for this. Jekyll docker image allows you to add system dependencies very easily. You just need to mention the dependent packages inside a file called .apk at the root of your project or beside Dockerfile. Since the docker image is based out of Alpine linux, you need to specify the correct package name as in Alpine packages.

Create a file called .apk and add the following line to it.

linux-headers

Now, when you bring up your containers, it will automatically install the linux-headers package which contains all the required header files and proceed to installing the gems successfully.

Exit mobile version