You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have to work on an old rails 4.2 codebase. I have installed Ruby 2.3 as a snap package - I am trying to avoid rvm.
Now, when I run bundle install it complains that it can't install the json gem. Here is the error message:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /home/user/.gem/gems/json-1.8.6/ext/json/ext/generator
//bin/ruby -r ./siteconf20190430-29073-znwkkd.rb extconf.rb
sh: 1: //bin/ruby: not found
I am having the same problem, gem install looks in /snap/ruby/109/lib/ruby/include:
$ gem install mysql2:0.3.21
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
current directory: /home/dayyan.lord/.gem/gems/mysql2-0.3.21/ext/mysql2
/snap/bin/ruby -r ./siteconf20190503-21474-2vfbku.rb extconf.rb
mkmf.rb can't find header files for ruby at /snap/ruby/109/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /home/dayyan.lord/.gem/gems/mysql2-0.3.21 for inspection.
Results logged to /home/dayyan.lord/.gem/extensions/x86_64-linux/2.3.0-static/mysql2-0.3.21/gem_make.out
The current location is:
$ ls /snap/ruby/109/include/ruby-2.3.0
ruby ruby.h x86_64-linux
After #26, installing gem with ext failed with glibc version mismatch on Debian 10 (buster).
I think this does not happen on ubuntu-20.04, but I don't know how to resolve this issue on other platform without glibc 2.29.
vagrant@buster:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Release: 10
Codename: buster
vagrant@buster:~$ gem i json
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
current directory: /home/vagrant/.gem/gems/json-2.6.0/ext/json/ext/parser
/snap/bin/ruby -I /snap/ruby/232/lib/ruby/3.0.0 -r ./siteconf20211020-3495-9mcx7g.rb extconf.rb
checking for rb_enc_raise() in ruby.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=/snap/ruby/232/bin/$(RUBY_BASE_NAME)
/snap/ruby/232/lib/ruby/3.0.0/mkmf.rb:471:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /snap/ruby/232/lib/ruby/3.0.0/mkmf.rb:564:in `try_link0'
from /snap/ruby/232/lib/ruby/3.0.0/mkmf.rb:582:in `try_link'
from /snap/ruby/232/lib/ruby/3.0.0/mkmf.rb:794:in `try_func'
from /snap/ruby/232/lib/ruby/3.0.0/mkmf.rb:1083:in `block in have_func'
from /snap/ruby/232/lib/ruby/3.0.0/mkmf.rb:971:in `block in checking_for'
from /snap/ruby/232/lib/ruby/3.0.0/mkmf.rb:361:in `block (2 levels) in postpone'
from /snap/ruby/232/lib/ruby/3.0.0/mkmf.rb:331:in `open'
from /snap/ruby/232/lib/ruby/3.0.0/mkmf.rb:361:in `block in postpone'
from /snap/ruby/232/lib/ruby/3.0.0/mkmf.rb:331:in `open'
from /snap/ruby/232/lib/ruby/3.0.0/mkmf.rb:357:in `postpone'
from /snap/ruby/232/lib/ruby/3.0.0/mkmf.rb:970:in `checking_for'
from /snap/ruby/232/lib/ruby/3.0.0/mkmf.rb:1082:in `have_func'
from extconf.rb:4:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/home/vagrant/.gem/extensions/x86_64-linux/3.0.0/json-2.6.0/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /home/vagrant/.gem/gems/json-2.6.0 for inspection.
Results logged to /home/vagrant/.gem/extensions/x86_64-linux/3.0.0/json-2.6.0/gem_make.out
vagrant@buster:~$ cat /home/vagrant/.gem/extensions/x86_64-linux/3.0.0/json-2.6.0/mkmf.log
"gcc -o conftest -I/snap/ruby/232/include/ruby-3.0.0/x86_64-linux -I/snap/ruby/232/include/ruby-3.0.0/ruby/backward -I/snap/ruby/232/include/ruby-3.0.0 -I. -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -fPIC conftest.c -L. -L/snap/ruby/232/lib -Wl,-rpath,/snap/ruby/232/lib -L. -L/root/parts/ruby/install/usr/lib -L/root/parts/ruby/install/usr/lib/x86_64-linux-gnu -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,-rpath,/snap/ruby/232/lib -L/snap/ruby/232/lib -lruby -lm -lc"
/usr/bin/ld: /snap/ruby/232/lib/libruby.so: undefined reference to `log2@GLIBC_2.29'
/usr/bin/ld: /snap/ruby/232/lib/libruby.so: undefined reference to `log@GLIBC_2.29'
/usr/bin/ld: //snap/core20/current/lib/x86_64-linux-gnu/libpthread.so.0: undefined reference to `__twalk_r@GLIBC_PRIVATE'
/usr/bin/ld: /snap/ruby/232/lib/libruby.so: undefined reference to `pow@GLIBC_2.29'
/usr/bin/ld: /snap/ruby/232/lib/libruby.so: undefined reference to `exp@GLIBC_2.29'
collect2: error: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return !!argv[argc];
6: }
/* end */
Any updates on this? I'm getting the same errors inside a core22 snap that includes this snap with stage-snaps: [ruby/3.3/stable] and tries to install json 2.7.4:
:: + /snap/bin/bundle version
:: Bundler version 2.5.22 (2024-11-21 commit unknown)
:: + cd /root/stage/app
:: + /snap/bin/bundle config set --local path /root/parts/bundle/install/app/vendor/bundle
:: + /snap/bin/bundle config set --local cache_path /root/parts/bundle/src
:: + /snap/bin/bundle config set --local silence_root_warning true
:: + /snap/bin/bundle config set --local jobs 1
:: + /snap/bin/bundle env
:: ## Environment
::
:: ```
:: Bundler 2.5.22
:: Platforms ruby, x86_64-linux
:: Ruby 3.3.6p108 (2024-11-05 revision 75015d4c1f6965b5e85e96fb309f1f2129f933c0) [x86_64-linux]
:: Full Path /snap/ruby/375/bin/ruby
:: Config Dir /etc
:: RubyGems 3.5.22
:: Gem Home /root/parts/bundle/install/app/vendor/bundle/ruby/3.3.0
:: Gem Path /root/parts/bundle/install/app/vendor/bundle/ruby/3.3.0
:: User Home /root
:: User Path /root/.local/share/gem/ruby/3.3.0
:: Bin Dir /root/parts/bundle/install/app/vendor/bundle/ruby/3.3.0/bin
:: Tools
:: Git 2.34.1
:: RVM not installed
:: rbenv not installed
:: chruby not installed
:: Gem.ruby /snap/ruby/375/bin/ruby
:: bundle #! /snap/ruby/current/bin/ruby
::
:: ```
::
:: ## Bundler Build Metadata
::
:: ```
:: Built At 2024-11-21
:: Git SHA unknown
:: Released Version false
:: ```
::
:: ## Bundler settings
::
:: ```
:: cache_path
:: Set for your local app (/root/stage/app/.bundle/config): "/root/parts/bundle/src"
:: jobs
:: Set for your local app (/root/stage/app/.bundle/config): 1
:: path
:: Set for your local app (/root/stage/app/.bundle/config): "/root/parts/bundle/install/app/vendor/bundle"
:: silence_root_warning
:: Set for your local app (/root/stage/app/.bundle/config): true
:: ```
:: Installing json 2.7.4 with native extensions
:: Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
::
:: current directory:
:: /root/parts/bundle/install/app/vendor/bundle/ruby/3.3.0/gems/json-2.7.4/ext/json/ext/generator
:: /snap/ruby/375/bin/ruby extconf.rb
:: checking for whether -std=c99 is accepted as CFLAGS... *** 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=${opt-dir}/include
:: --without-opt-include
:: --with-opt-lib=${opt-dir}/lib
:: --without-opt-lib
:: --with-make-prog
:: --without-make-prog
:: --srcdir=.
:: --curdir
:: --ruby=/snap/ruby/375/bin/$(RUBY_BASE_NAME)
:: /snap/ruby/375/lib/ruby/3.3.0/mkmf.rb:480:in `try_do': The compiler failed to
:: generate an executable file. (RuntimeError)
:: You have to install development tools first.
::
:: from /snap/ruby/375/lib/ruby/3.3.0/mkmf.rb:606:in `block in try_compile'
:: from /snap/ruby/375/lib/ruby/3.3.0/mkmf.rb:553:in `with_werror'
:: from /snap/ruby/375/lib/ruby/3.3.0/mkmf.rb:606:in `try_compile'
:: from /snap/ruby/375/lib/ruby/3.3.0/mkmf.rb:670:in `try_cflags'
:: from /snap/ruby/375/lib/ruby/3.3.0/mkmf.rb:1019:in `block (2 levels) in
:: append_cflags'
:: from /snap/ruby/375/lib/ruby/3.3.0/mkmf.rb:983:in `block in checking_for'
:: from /snap/ruby/375/lib/ruby/3.3.0/mkmf.rb:344:in `block (2 levels) in
:: postpone'
:: from /snap/ruby/375/lib/ruby/3.3.0/mkmf.rb:314:in `open'
:: from /snap/ruby/375/lib/ruby/3.3.0/mkmf.rb:344:in `block in postpone'
:: from /snap/ruby/375/lib/ruby/3.3.0/mkmf.rb:314:in `open'
:: from /snap/ruby/375/lib/ruby/3.3.0/mkmf.rb:340:in `postpone'
:: from /snap/ruby/375/lib/ruby/3.3.0/mkmf.rb:982:in `checking_for'
:: from /snap/ruby/375/lib/ruby/3.3.0/mkmf.rb:1018:in `block in append_cflags'
:: from /snap/ruby/375/lib/ruby/3.3.0/mkmf.rb:1017:in `each'
:: from /snap/ruby/375/lib/ruby/3.3.0/mkmf.rb:1017:in `append_cflags'
:: from extconf.rb:7:in `<main>'
Development tools (build-essential, autoconf, automake, cmake, pkg-config, ...) are installed via build-packages.
I am experiencing the same issue installing Jekyll for GitHub Pages.
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /home/xxx/projects/yyy/zzz/vendor/bundle/ruby/3.4.0/gems/eventmachine-1.2.7/ext
/snap/ruby/419/bin/ruby extconf.rb
checking for pkg-config for openssl... not found
checking for -lcrypto... *** 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=${opt-dir}/include
--without-opt-include
--with-opt-lib=${opt-dir}/lib
--without-opt-lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/snap/ruby/419/bin/$(RUBY_BASE_NAME)
--with-ssl-dir
--without-ssl-dir
--with-ssl-include=${ssl-dir}/include
--without-ssl-include
--with-ssl-lib=${ssl-dir}/lib
--without-ssl-lib
--with-openssl-dir
--without-openssl-dir
--with-openssl-include=${openssl-dir}/include
--without-openssl-include
--with-openssl-lib=${openssl-dir}/lib
--without-openssl-lib
--with-openssl-config
--without-openssl-config
--with-pkg-config
--without-pkg-config
--with-crypto-dir
--without-crypto-dir
--with-crypto-include=${crypto-dir}/include
--without-crypto-include
--with-crypto-lib=${crypto-dir}/lib
--without-crypto-lib
--with-cryptolib
--without-cryptolib
/snap/ruby/419/lib/ruby/3.4.0/mkmf.rb:528:in 'MakeMakefile#try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /snap/ruby/419/lib/ruby/3.4.0/mkmf.rb:621:in 'MakeMakefile#try_link0'
from /snap/ruby/419/lib/ruby/3.4.0/mkmf.rb:639:in 'MakeMakefile#try_link'
from /snap/ruby/419/lib/ruby/3.4.0/mkmf.rb:888:in 'MakeMakefile#try_func'
from /snap/ruby/419/lib/ruby/3.4.0/mkmf.rb:1147:in 'block in MakeMakefile#have_library'
from /snap/ruby/419/lib/ruby/3.4.0/mkmf.rb:1070:in 'block in MakeMakefile#checking_for'
from /snap/ruby/419/lib/ruby/3.4.0/mkmf.rb:370:in 'block (2 levels) in MakeMakefile::Logging.postpone'
from /snap/ruby/419/lib/ruby/3.4.0/mkmf.rb:340:in 'MakeMakefile::Logging.open'
from /snap/ruby/419/lib/ruby/3.4.0/mkmf.rb:370:in 'block in MakeMakefile::Logging.postpone'
from /snap/ruby/419/lib/ruby/3.4.0/mkmf.rb:340:in 'MakeMakefile::Logging.open'
from /snap/ruby/419/lib/ruby/3.4.0/mkmf.rb:366:in 'MakeMakefile::Logging.postpone'
from /snap/ruby/419/lib/ruby/3.4.0/mkmf.rb:1069:in 'MakeMakefile#checking_for'
from /snap/ruby/419/lib/ruby/3.4.0/mkmf.rb:1142:in 'MakeMakefile#have_library'
from extconf.rb:8:in 'block in Object#check_libs'
from extconf.rb:8:in 'Array#all?'
from extconf.rb:8:in 'Object#check_libs'
from extconf.rb:95:in '<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/home/xxx/projects/yyy/zzz/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/eventmachine-1.2.7/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /home/xxx/projects/yyy/zzz/vendor/bundle/ruby/3.4.0/gems/eventmachine-1.2.7 for inspection.
Results logged to /home/xxx/projects/yyy/zzz/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/eventmachine-1.2.7/gem_make.out
/snap/ruby/419/lib/ruby/3.4.0/rubygems/ext/builder.rb:126:in 'Gem::Ext::Builder.run'
/snap/ruby/419/lib/ruby/3.4.0/rubygems/ext/ext_conf_builder.rb:30:in 'Gem::Ext::ExtConfBuilder.build'
/snap/ruby/419/lib/ruby/3.4.0/rubygems/ext/builder.rb:195:in 'Gem::Ext::Builder#build_extension'
/snap/ruby/419/lib/ruby/3.4.0/rubygems/ext/builder.rb:229:in 'block in Gem::Ext::Builder#build_extensions'
/snap/ruby/419/lib/ruby/3.4.0/rubygems/ext/builder.rb:226:in 'Array#each'
/snap/ruby/419/lib/ruby/3.4.0/rubygems/ext/builder.rb:226:in 'Gem::Ext::Builder#build_extensions'
/snap/ruby/419/lib/ruby/3.4.0/rubygems/installer.rb:844:in 'Gem::Installer#build_extensions'
/snap/ruby/419/lib/ruby/3.4.0/bundler/rubygems_gem_installer.rb:111:in 'Bundler::RubyGemsGemInstaller#build_extensions'
/snap/ruby/419/lib/ruby/3.4.0/bundler/rubygems_gem_installer.rb:30:in 'Bundler::RubyGemsGemInstaller#install'
/snap/ruby/419/lib/ruby/3.4.0/bundler/source/rubygems.rb:220:in 'Bundler::Source::Rubygems#install'
/snap/ruby/419/lib/ruby/3.4.0/bundler/installer/gem_installer.rb:55:in 'Bundler::GemInstaller#install'
/snap/ruby/419/lib/ruby/3.4.0/bundler/installer/gem_installer.rb:17:in 'Bundler::GemInstaller#install_from_spec'
/snap/ruby/419/lib/ruby/3.4.0/bundler/installer/parallel_installer.rb:133:in 'Bundler::ParallelInstaller#do_install'
/snap/ruby/419/lib/ruby/3.4.0/bundler/installer/parallel_installer.rb:124:in 'block in Bundler::ParallelInstaller#worker_pool'
/snap/ruby/419/lib/ruby/3.4.0/bundler/worker.rb:62:in 'Bundler::Worker#apply_func'
/snap/ruby/419/lib/ruby/3.4.0/bundler/worker.rb:57:in 'block in Bundler::Worker#process_queue'<internal:kernel>:168:in 'Kernel#loop'
/snap/ruby/419/lib/ruby/3.4.0/bundler/worker.rb:54:in 'Bundler::Worker#process_queue'
/snap/ruby/419/lib/ruby/3.4.0/bundler/worker.rb:90:in 'block (2 levels) in Bundler::Worker#create_threads'
An error occurred while installing eventmachine (1.2.7), and Bundler cannot continue.
In Gemfile:
jekyll was resolved to 3.10.0, which depends on
em-websocket was resolved to 0.5.3, which depends on
eventmachine
mkmf.log
LD_LIBRARY_PATH=.:/snap/ruby/419/lib ASAN_OPTIONS=detect_leaks=0 pkg-config --exists openssl
package configuration for openssl is not found
--------------------
LD_LIBRARY_PATH=.:/snap/ruby/419/lib ASAN_OPTIONS=detect_leaks=0 "gcc -o conftest -I/snap/ruby/419/include/ruby-3.4.0/x86_64-linux -I/snap/ruby/419/include/ruby-3.4.0/ruby/backward -I/snap/ruby/419/include/ruby-3.4.0 -I. -fstack-protector-strong -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdiv-by-zero -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wwrite-strings -Wold-style-definition -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -Wmisleading-indentation -Wundef -fPIC conftest.c -L. -L/snap/ruby/419/lib -Wl,-rpath,/snap/ruby/419/lib -L. -L/root/parts/ruby/install/usr/lib -L/root/parts/ruby/install/usr/lib/x86_64-linux-gnu -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,--no-as-needed -Wl,-rpath,/snap/ruby/419/lib -L/snap/ruby/419/lib -lruby -lm -lpthread -lc"
/usr/bin/ld: /snap/core20/current/lib/x86_64-linux-gnu/libdl.so.2: undefined reference to `_dl_sym@GLIBC_PRIVATE'/usr/bin/ld: /snap/core20/current/lib/x86_64-linux-gnu/libpthread.so.0: undefined reference to `__libc_dlclose@GLIBC_PRIVATE'/usr/bin/ld: /snap/core20/current/lib/x86_64-linux-gnu/libpthread.so.0: undefined reference to `__libc_allocate_rtsig_private@GLIBC_PRIVATE'/usr/bin/ld: /snap/core20/current/lib/x86_64-linux-gnu/libpthread.so.0: undefined reference to `__libc_dlsym@GLIBC_PRIVATE'
/usr/bin/ld: /snap/core20/current/lib/x86_64-linux-gnu/libpthread.so.0: undefined reference to `__libc_siglongjmp@GLIBC_PRIVATE'/usr/bin/ld: /snap/core20/current/lib/x86_64-linux-gnu/libpthread.so.0: undefined reference to `__libc_thread_freeres@GLIBC_PRIVATE'/usr/bin/ld: /snap/core20/current/lib/x86_64-linux-gnu/libpthread.so.0: undefined reference to `__libc_current_sigrtmax_private@GLIBC_PRIVATE'/usr/bin/ld: /snap/core20/current/lib/x86_64-linux-gnu/libdl.so.2: undefined reference to `_dl_vsym@GLIBC_PRIVATE'
/usr/bin/ld: /snap/core20/current/lib/x86_64-linux-gnu/libpthread.so.0: undefined reference to `__libc_current_sigrtmin_private@GLIBC_PRIVATE'/usr/bin/ld: /snap/core20/current/lib/x86_64-linux-gnu/libpthread.so.0: undefined reference to `_dl_make_stack_executable@GLIBC_PRIVATE'/usr/bin/ld: /snap/core20/current/lib/x86_64-linux-gnu/libpthread.so.0: undefined reference to `__libc_longjmp@GLIBC_PRIVATE'/usr/bin/ld: /snap/core20/current/lib/x86_64-linux-gnu/libpthread.so.0: undefined reference to `__libc_dlopen_mode@GLIBC_PRIVATE'
/usr/bin/ld: /snap/core20/current/lib/x86_64-linux-gnu/libdl.so.2: undefined reference to `_dl_addr@GLIBC_PRIVATE'/usr/bin/ld: /snap/core20/current/lib/x86_64-linux-gnu/libpthread.so.0: undefined reference to `__libc_pthread_init@GLIBC_PRIVATE'collect2: error: ld returned 1 exit statuschecked program was:/* begin */1: #include "ruby.h"2: 3: int main(int argc, char **argv)4: {5: return !!argv[argc];6: }/* end */
Is there a way to adjust -I and -L parameters with Ruby snap?
Activity
dayyan commentedon May 3, 2019
I am having the same problem,
gem installlooks in/snap/ruby/109/lib/ruby/include:The current location is:
choallin commentedon May 14, 2019
@dayyan Have you found a solution to this?
dayyan commentedon May 14, 2019
@choallin Sorry, I have not. I ended up compiling Ruby copying the same commands the Dockerfile uses.
hsbt commentedon Jun 2, 2019
Hi all, Thanks to reporting this. I confirmed this is an issue of my package script for snap. I try to investigate json and mysql2 cases.
bmaupin commentedon Jul 11, 2019
It seems like this could be the same problem I ran into trying to install eventmachine: eventmachine/eventmachine#881
Based on the comments there, it sounds like
bundleis unable to find the Ruby headers.znz commentedon Oct 20, 2021
After #26, installing gem with ext failed with glibc version mismatch on Debian 10 (buster).
I think this does not happen on ubuntu-20.04, but I don't know how to resolve this issue on other platform without glibc 2.29.
hloeung commentedon Oct 25, 2021
Seeing this as well, with a different set of gems - #28
paddor commentedon Nov 21, 2024
Any updates on this? I'm getting the same errors inside a
core22snap that includes this snap withstage-snaps: [ruby/3.3/stable]and tries to install json 2.7.4:Development tools (
build-essential,autoconf,automake,cmake,pkg-config, ...) are installed viabuild-packages.igorpupkinable commentedon Jun 24, 2025
I am experiencing the same issue installing Jekyll for GitHub Pages.
Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /home/xxx/projects/yyy/zzz/vendor/bundle/ruby/3.4.0/gems/eventmachine-1.2.7/ext /snap/ruby/419/bin/ruby extconf.rb checking for pkg-config for openssl... not found checking for -lcrypto... *** 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=${opt-dir}/include --without-opt-include --with-opt-lib=${opt-dir}/lib --without-opt-lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/snap/ruby/419/bin/$(RUBY_BASE_NAME) --with-ssl-dir --without-ssl-dir --with-ssl-include=${ssl-dir}/include --without-ssl-include --with-ssl-lib=${ssl-dir}/lib --without-ssl-lib --with-openssl-dir --without-openssl-dir --with-openssl-include=${openssl-dir}/include --without-openssl-include --with-openssl-lib=${openssl-dir}/lib --without-openssl-lib --with-openssl-config --without-openssl-config --with-pkg-config --without-pkg-config --with-crypto-dir --without-crypto-dir --with-crypto-include=${crypto-dir}/include --without-crypto-include --with-crypto-lib=${crypto-dir}/lib --without-crypto-lib --with-cryptolib --without-cryptolib /snap/ruby/419/lib/ruby/3.4.0/mkmf.rb:528:in 'MakeMakefile#try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from /snap/ruby/419/lib/ruby/3.4.0/mkmf.rb:621:in 'MakeMakefile#try_link0' from /snap/ruby/419/lib/ruby/3.4.0/mkmf.rb:639:in 'MakeMakefile#try_link' from /snap/ruby/419/lib/ruby/3.4.0/mkmf.rb:888:in 'MakeMakefile#try_func' from /snap/ruby/419/lib/ruby/3.4.0/mkmf.rb:1147:in 'block in MakeMakefile#have_library' from /snap/ruby/419/lib/ruby/3.4.0/mkmf.rb:1070:in 'block in MakeMakefile#checking_for' from /snap/ruby/419/lib/ruby/3.4.0/mkmf.rb:370:in 'block (2 levels) in MakeMakefile::Logging.postpone' from /snap/ruby/419/lib/ruby/3.4.0/mkmf.rb:340:in 'MakeMakefile::Logging.open' from /snap/ruby/419/lib/ruby/3.4.0/mkmf.rb:370:in 'block in MakeMakefile::Logging.postpone' from /snap/ruby/419/lib/ruby/3.4.0/mkmf.rb:340:in 'MakeMakefile::Logging.open' from /snap/ruby/419/lib/ruby/3.4.0/mkmf.rb:366:in 'MakeMakefile::Logging.postpone' from /snap/ruby/419/lib/ruby/3.4.0/mkmf.rb:1069:in 'MakeMakefile#checking_for' from /snap/ruby/419/lib/ruby/3.4.0/mkmf.rb:1142:in 'MakeMakefile#have_library' from extconf.rb:8:in 'block in Object#check_libs' from extconf.rb:8:in 'Array#all?' from extconf.rb:8:in 'Object#check_libs' from extconf.rb:95:in '<main>' To see why this extension failed to compile, please check the mkmf.log which can be found here: /home/xxx/projects/yyy/zzz/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/eventmachine-1.2.7/mkmf.log extconf failed, exit code 1 Gem files will remain installed in /home/xxx/projects/yyy/zzz/vendor/bundle/ruby/3.4.0/gems/eventmachine-1.2.7 for inspection. Results logged to /home/xxx/projects/yyy/zzz/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/eventmachine-1.2.7/gem_make.out /snap/ruby/419/lib/ruby/3.4.0/rubygems/ext/builder.rb:126:in 'Gem::Ext::Builder.run' /snap/ruby/419/lib/ruby/3.4.0/rubygems/ext/ext_conf_builder.rb:30:in 'Gem::Ext::ExtConfBuilder.build' /snap/ruby/419/lib/ruby/3.4.0/rubygems/ext/builder.rb:195:in 'Gem::Ext::Builder#build_extension' /snap/ruby/419/lib/ruby/3.4.0/rubygems/ext/builder.rb:229:in 'block in Gem::Ext::Builder#build_extensions' /snap/ruby/419/lib/ruby/3.4.0/rubygems/ext/builder.rb:226:in 'Array#each' /snap/ruby/419/lib/ruby/3.4.0/rubygems/ext/builder.rb:226:in 'Gem::Ext::Builder#build_extensions' /snap/ruby/419/lib/ruby/3.4.0/rubygems/installer.rb:844:in 'Gem::Installer#build_extensions' /snap/ruby/419/lib/ruby/3.4.0/bundler/rubygems_gem_installer.rb:111:in 'Bundler::RubyGemsGemInstaller#build_extensions' /snap/ruby/419/lib/ruby/3.4.0/bundler/rubygems_gem_installer.rb:30:in 'Bundler::RubyGemsGemInstaller#install' /snap/ruby/419/lib/ruby/3.4.0/bundler/source/rubygems.rb:220:in 'Bundler::Source::Rubygems#install' /snap/ruby/419/lib/ruby/3.4.0/bundler/installer/gem_installer.rb:55:in 'Bundler::GemInstaller#install' /snap/ruby/419/lib/ruby/3.4.0/bundler/installer/gem_installer.rb:17:in 'Bundler::GemInstaller#install_from_spec' /snap/ruby/419/lib/ruby/3.4.0/bundler/installer/parallel_installer.rb:133:in 'Bundler::ParallelInstaller#do_install' /snap/ruby/419/lib/ruby/3.4.0/bundler/installer/parallel_installer.rb:124:in 'block in Bundler::ParallelInstaller#worker_pool' /snap/ruby/419/lib/ruby/3.4.0/bundler/worker.rb:62:in 'Bundler::Worker#apply_func' /snap/ruby/419/lib/ruby/3.4.0/bundler/worker.rb:57:in 'block in Bundler::Worker#process_queue' <internal:kernel>:168:in 'Kernel#loop' /snap/ruby/419/lib/ruby/3.4.0/bundler/worker.rb:54:in 'Bundler::Worker#process_queue' /snap/ruby/419/lib/ruby/3.4.0/bundler/worker.rb:90:in 'block (2 levels) in Bundler::Worker#create_threads' An error occurred while installing eventmachine (1.2.7), and Bundler cannot continue. In Gemfile: jekyll was resolved to 3.10.0, which depends on em-websocket was resolved to 0.5.3, which depends on eventmachinemkmf.log
Is there a way to adjust
-Iand-Lparameters with Ruby snap?