Repository navigation
libc.so: invalid ELF header with ruby:3.1.2 Docker image #263
Copy link
Copy link
Open
Description
What version of Bootstrap Email are you using?
1.5.1
How are you compiling?
CLI
Code example
No response
Describe your issue
I started getting this error after the 1.5.1 upgrade, using the Docker image ruby:3.1.2:
$ gem install bootstrap-email
Successfully installed google-protobuf-4.26.1-x86_64-linux
Successfully installed sass-embedded-1.75.0-x86_64-linux-android
Successfully installed htmlentities-4.3.4
Successfully installed public_suffix-5.0.5
Successfully installed addressable-2.8.6
Successfully installed css_parser-1.17.1
Successfully installed premailer-1.23.0
Successfully installed nokogiri-1.16.4-x86_64-linux
Successfully installed htmlbeautifier-1.4.3
Successfully installed bootstrap-email-1.5.1
10 gems installed
$ bootstrap-email templates > "../emails"
/usr/local/bundle/gems/sass-embedded-1.75.0-x86_64-linux-android/lib/sass/compiler/connection.rb:54: warning: /usr/local/bundle/gems/sass-embedded-1.75.0-x86_64-linux-android/ext/sass/dart-sass/src/dart: error while loading shared libraries: /usr/lib/x86_64-linux-gnu/libc.so: invalid ELF header
/usr/local/bundle/gems/sass-embedded-1.75.0-x86_64-linux-android/lib/sass/compiler/connection.rb:85:in `write': Broken pipe (Errno::EPIPE)
from /usr/local/bundle/gems/sass-embedded-1.75.0-x86_64-linux-android/lib/sass/compiler/connection.rb:85:in `block in write'
from /usr/local/bundle/gems/sass-embedded-1.75.0-x86_64-linux-android/lib/sass/compiler/connection.rb:84:in `synchronize'
from /usr/local/bundle/gems/sass-embedded-1.75.0-x86_64-linux-android/lib/sass/compiler/connection.rb:84:in `write'
from /usr/local/bundle/gems/sass-embedded-1.75.0-x86_64-linux-android/lib/sass/compiler/dispatcher.rb:91:in `send_proto'
from /usr/local/bundle/gems/sass-embedded-1.75.0-x86_64-linux-android/lib/sass/compiler/channel.rb:59:in `send_proto'
from /usr/local/bundle/gems/sass-embedded-1.75.0-x86_64-linux-android/lib/sass/compiler/host.rb:220:in `send_message'
from /usr/local/bundle/gems/sass-embedded-1.75.0-x86_64-linux-android/lib/sass/compiler/host.rb:79:in `block in compile_request'
from /usr/local/bundle/gems/sass-embedded-1.75.0-x86_64-linux-android/lib/sass/compiler/host.rb:181:in `block in await'
from /usr/local/bundle/gems/sass-embedded-1.75.0-x86_64-linux-android/lib/sass/compiler/host.rb:199:in `listen'
from /usr/local/bundle/gems/sass-embedded-1.75.0-x86_64-linux-android/lib/sass/compiler/host.rb:180:in `await'
from /usr/local/bundle/gems/sass-embedded-1.75.0-x86_64-linux-android/lib/sass/compiler/host.rb:78:in `compile_request'
from /usr/local/bundle/gems/sass-embedded-1.75.0-x86_64-linux-android/lib/sass/compiler.rb:171:in `compile_string'
from /usr/local/bundle/gems/sass-embedded-1.75.0-x86_64-linux-android/lib/sass/embedded.rb:37:in `compile_string'
from /usr/local/bundle/gems/bootstrap-email-1.5.1/lib/bootstrap-email/sass_cache.rb:74:in `compile_css'
from /usr/local/bundle/gems/bootstrap-email-1.5.1/lib/bootstrap-email/sass_cache.rb:66:in `compile_and_cache_scss'
from /usr/local/bundle/gems/bootstrap-email-1.5.1/lib/bootstrap-email/sass_cache.rb:34:in `block in compile'
from /usr/local/bundle/gems/bootstrap-email-1.5.1/lib/bootstrap-email/sass_cache.rb:28:in `open'
from /usr/local/bundle/gems/bootstrap-email-1.5.1/lib/bootstrap-email/sass_cache.rb:28:in `compile'
from /usr/local/bundle/gems/bootstrap-email-1.5.1/lib/bootstrap-email/sass_cache.rb:8:in `compile'
from /usr/local/bundle/gems/bootstrap-email-1.5.1/lib/bootstrap-email/compiler.rb:54:in `build_premailer_doc'
from /usr/local/bundle/gems/bootstrap-email-1.5.1/lib/bootstrap-email/compiler.rb:17:in `initialize'
from /usr/local/bundle/gems/bootstrap-email-1.5.1/lib/bootstrap-email/bootstrap_email_cli.rb:91:in `new'
from /usr/local/bundle/gems/bootstrap-email-1.5.1/lib/bootstrap-email/bootstrap_email_cli.rb:91:in `<top (required)>'
from /usr/local/bundle/gems/bootstrap-email-1.5.1/bin/bootstrap-email:4:in `require_relative'
from /usr/local/bundle/gems/bootstrap-email-1.5.1/bin/bootstrap-email:4:in `<top (required)>'
from /usr/local/bundle/bin/bootstrap-email:[25](https://gitlab.com/rudol/webapp/-/jobs/6740678347#L25):in `load'
from /usr/local/bundle/bin/bootstrap-email:25:in `<main>'
Rolling back to bootstrap-email version 1.4.1 solves the issue for now.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
ntkme commentedon May 8, 2024
This is a well known bug for the old RubyGems bundled in Ruby 3.1.2. If you upgrade to Ruby 3.1.5, 3.2 or later, it should fix this problem.
The root cause was older versions of RubyGems can not tell the difference between linux-gnu, linux-musl, and linux-android, and it will randomly pick the wrong version to install, thus causing the issue. See ruby/rubygems#5852 and ruby/rubygems#5889.