Describe the bug
Unable to install gems with native extensions (e.g. bcrypt, pg, etc) on 3.3.0 images due to missing jemalloc headers. Attempting to the following error:
Fetching bcrypt-3.1.20.gem
Building native extensions. This could take a while...
ERROR: Error installing bcrypt:
ERROR: Failed to build gem native extension.
current directory: /home/circleci/.rubygems/gems/bcrypt-3.1.20/ext/mri
/usr/local/bin/ruby extconf.rb
creating Makefile
current directory: /home/circleci/.rubygems/gems/bcrypt-3.1.20/ext/mri
make DESTDIR\= sitearchdir\=./.gem.20240102-13-gnagja sitelibdir\=./.gem.20240102-13-gnagja clean
current directory: /home/circleci/.rubygems/gems/bcrypt-3.1.20/ext/mri
make DESTDIR\= sitearchdir\=./.gem.20240102-13-gnagja sitelibdir\=./.gem.20240102-13-gnagja
compiling bcrypt_ext.c
In file included from /usr/local/include/ruby-3.3.0/ruby/internal/config.h:22,
from /usr/local/include/ruby-3.3.0/ruby/ruby.h:15,
from /usr/local/include/ruby-3.3.0/ruby.h:38,
from bcrypt_ext.c:1:
/usr/local/include/ruby-3.3.0/x86_64-linux/ruby/config.h:82:40: fatal error: jemalloc/jemalloc.h: No such file or directory
82 | #define RUBY_ALTERNATIVE_MALLOC_HEADER <jemalloc/jemalloc.h>
| ^
compilation terminated.
make: *** [Makefile:248: bcrypt_ext.o] Error 1
make failed, exit code 2
Gem files will remain installed in /home/circleci/.rubygems/gems/bcrypt-3.1.20 for inspection.
Results logged to /home/circleci/.rubygems/extensions/x86_64-linux/3.3.0/bcrypt-3.1.20/gem_make.out
To Reproduce
docker run -it cimg/ruby:3.3.0 bash
gem install bcrypt
Expected behavior
Gems install.
Workarounds
This appears to be an issue with the Dockerfile.template including a flag not present in any other Dockerfile for usage of jemalloc. It appears this flag was introduced without building an image:
Describe the bug Unable to install gems with native extensions (e.g.
bcrypt
,pg
, etc) on 3.3.0 images due to missing jemalloc headers. Attempting to the following error:To Reproduce
Expected behavior Gems install.
Workarounds This appears to be an issue with the
Dockerfile.template
including a flag not present in any other Dockerfile for usage of jemalloc. It appears this flag was introduced without building an image:https://github.com/CircleCI-Public/cimg-ruby/pull/139